Re: DRM Inquiry

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jani,

Good day!

Thank you for taking the time to point out those information. It’s a great help to me.
Also apologies for the late reply, your first reply went to my spam inbox, not sure what happen and I was waiting for replies for days.

I'm still new to Linux and to DRM. I also need to investigate and learn more about it.

Here's what I have done so far. I was able to work on the modeprint test application from the libdrm package found in the website github.com/grate-driver/libdrm. I need to understand how user space and kernel works and modeprint provided me a simple understanding how it works.
The modeprint requires a module name to open and I provided the i915 module. It followed opening the device name then calling ioctl commands to get resources, drm mode get connectors, encoders and crtc. From here, i was able to detect the display device's information successfully.

So from here I got stuck and got confused. I only notice that in the drm.h it has limited IOCTL commands which it doesn't reach what i needed like to reach scope in drm_dp_helper.c or intel_dp.c where the dp aux read/write functions.

Okay, back to your advice. Correct, I'm trying to access DPCD from the userspace. I haven't tried it and I'm not sure how it will goes out. I will try it now and I will give feedback on this.
From what I understand, I need to rebuild the entire kernel with modification to Kconfig file (depends on DRM=y) in linux-4.16\drivers\gpu\drm directory. Then expect /dev/drm_dp_auxN node in the system.

config DRM_DP_AUX_CHARDEV
bool "DRM DP AUX Interface"
depends on DRM=y
help
  Choose this option to enable a /dev/drm_dp_auxN node that allows to
  read and write values to arbitrary DPCD registers on the DP aux
  channel.

The second advice, I guess your correct since the display device i needed to communicate is under Connector: DP-1 and not in Connector: eDP-1. This is based on the application modeprint result.

Regards,
John





On Friday, May 18, 2018, 5:48:31 PM GMT+8, Jani Nikula <jani.nikula@xxxxxxxxxxxxxxx> wrote:


On Thu, 17 May 2018, John Sledge <john_sledget@xxxxxxxxx> wrote:

> I’ve been doing some PTN3460 programming under Linux using C/C++ and I
> have some questions regarding on setting the brightness level to my
> display device.
>
> The display device with PTN3460 is connected in DP (display port) to
> my computer. Only needs a DisplayPort native AUX command to access
> DPCD address from PTN3460.  I’m currently looking into the DRM (Direct
> Rendering Manager) a subsystem of the Linux kernel. It has a methods
> drm_dp_dpcd_readb, drm_dp_dpcd_read and drm_dp_dpcd_write.
>
> Do you have any suggestions or advice how to use the kernel driver in
> DRM in regards to how to implement the method drm_dp_dpcd_readb for
> example? I couldn't not find any test tool examples that implement
> it. Biggest concern is I don't have sufficient knowledge where to
> start what to code using the DRM module.


Let me double check, you're talking about doing DPCD access from
userspace? The *only* interface that can be recommended for that is the
DRM DP AUX interface. If you have kernel config DRM_DP_AUX_CHARDEV=y,
you'll get /dev/drm_dp_auxN node(s) that allows you to read and write
arbitrary DPCD offsets. It's a chardev; you can use e.g. dd to debug
read DPCD.

Of course, it would be better to have a generic backlight interface for
DPCD based backlight in kernel. We have the basics for that for Intel
GPU in i915/intel_dp_aux_backlight.c. Granted, it should be moved to
common DRM code, but it also doesn't work for you if you have the chip
connected to regular DP. It expects eDP, and somewhat spec compliant eDP
DPCD backlight support.

HTH,
Jani.


--
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux