<html><head></head><body><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:10px;"><div></div>
<div>Hi Jani,</div><div><br></div><div>I can now see /dev/drm_dp_aux*.</div><div><br></div><div>I'm not familiar with dd command.Correct me if I'm wrong.</div><div><br></div><div>Possible commands i tried and nothing happen:</div><div>dd if=/dev/drm_dp_aux1 seek=723 ibs=2</div><div><span><span style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;">dd of=/dev/drm_dp_aux1 seek=723 ibs=2</span></span><br></div><div><span><span style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;"><span><div style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;">dd if=/dev/drm_dp_aux2 seek=723 ibs=2</div><div style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;">dd of=/dev/drm_dp_aux2 seek=723 ibs=2</div></span><br></span></span></div><div>I assumed I could read the brightness msb and lsb using the define in drm_dp_helper.h.<br></div><div><span><div>#define DP_EDP_BACKLIGHT_BRIGHTNESS_MSB 0x722</div><div>#define DP_EDP_BACKLIGHT_BRIGHTNESS_LSB 0x723</div><div><br></div><div>From here, I was thinking if I could try to open \dev\drm_dp_aux* then read the brightness offset 0x723, though not sure how to proceed with it.</div><div>I was able to successfully open \dev\drm_dp_aux1 and \dev\drm_dp_aux2 but I thinking I'm wrong when I proceed to ioctl because they all failed.</div><div><br></div><div><br></div><div>#define BRIGHTNESS 0x723</div><div><br></div><div>int main(int argc, char ** argv)</div><div>{</div><div> int fd;</div><div> int retcode;</div><div> char out[128];</div><div> </div><div> if((fd = open("/dev/drm_dp_aux1",O_RDWR)) >=0)</div><div> {</div><div> printf("open success");</div><div> }</div><div> else</div><div> {</div><div><span><span style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;"> printf("open failed");</span></span><br></div><div> }</div><div><br></div><div> <span><div style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;"> if((retcode = ioctl(fd,BRIGHTNESS,&out)) < 0)</div><div style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;"> {</div><div style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;"> printf("ioctl failed");</div><div style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;"> }</div><div style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;"> else</div><div style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;"> {</div><div style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;"> printf("ioctl success");<br></div><div style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;"> }</div><div style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;"><br></div><div style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;"> // trying aux2</div><div style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;"><span><div style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;"> if((fd = open("/dev/drm_dp_aux2",O_RDWR)) >=0)</div><div style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;"> {</div><div style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;"> printf("open success");</div><div style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;"> }</div><div style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;"> else</div><div style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;"> {</div><div style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;"> printf("open failed");<br></div><div style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;"> }</div><div style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;"><br></div><div style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px;"><div> if((retcode = ioctl(fd,BRIGHTNESS,&out)) < 0)</div><div> {</div><div> printf("ioctl failed");</div><div> }</div><div> else</div><div> {</div><div> printf("ioctl success");<br></div><div> }</div></div></span><br></div></span> return 0;</div><div>}</div><div><br></div><div>Thanks,</div><div>John</div></span><br></div><div><br></div>
<div id="yahoo_quoted_7358275000" class="yahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
On Thursday, May 24, 2018, 8:38:02 PM GMT+8, Jani Nikula <jani.nikula@linux.intel.com> wrote:
</div>
<div><br></div>
<div><br></div>
<div><div dir="ltr">On Thu, 24 May 2018, John Sledge <<a shape="rect" ymailto="mailto:john_sledget@yahoo.com" href="mailto:john_sledget@yahoo.com">john_sledget@yahoo.com</a>> wrote:<br clear="none">> I was able to update my kernel to 4.6 which has the DRM_DP_AUX_CHARDEV<br clear="none">> in the Kconfig file linux-4.6\drivers\gpu\drm. Though I also<br clear="none">> add DRM_DP_AUX_CHARDEV=y in kernel config. When invoke uname -r, I<br clear="none">> could see that the kernel is now 4.6.<br clear="none"><br clear="none">If you're updating kernels, why not update to a recent kernel that's<br clear="none">actually supported...?<br clear="none"><br clear="none">> How can I verify the DRM_DP_AUX_CHARDEV takes effect or got configure<br clear="none">> it correctly?<br clear="none"><br clear="none">Boot the kernel, run 'ls /dev/drm_dp_aux*'. If you see stuff, you got it<br clear="none">right.<br clear="none"><br clear="none">> It still unclear to me how to follow what you mean by using DRM DP AUX<br clear="none">> interface and getting /dev/drm_dp_auxN node(s) that allows me to read<br clear="none">> and write arbitrary DPCD offsets. <br clear="none"><br clear="none">The device is a char device you can open, seek to an offset (which would<br clear="none">be the DPCD offset), and read. For testing, you can achieve the same<br clear="none">using dd.<br clear="none"><br clear="none">BR,<div class="yqt3830274404" id="yqtfd98816"><br clear="none">Jani.<br clear="none"><br clear="none">-- <br clear="none">Jani Nikula, Intel Open Source Graphics Center</div><br clear="none">_______________________________________________<br clear="none">dri-devel mailing list<br clear="none"><a shape="rect" ymailto="mailto:dri-devel@lists.freedesktop.org" href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br clear="none"><a shape="rect" href="https://lists.freedesktop.org/mailman/listinfo/dri-devel" target="_blank">https://lists.freedesktop.org/mailman/listinfo/dri-devel</a><div class="yqt3830274404" id="yqtfd86737"><br clear="none"></div></div></div>
</div>
</div></div></body></html>