Looks like the seek=%d in the sprintf is not working. 0x11 0x0A are being 
returned by the monitor from DPCD’s 0x0000 and 0x0001 repeatedly. The first is 
DPCD revision (1.1) and the second is maximum Link Rate (0x0a) which is 2.7 
Gbps. You might want to do a printf of call to make sure seek is being set 
correctly.

Which brings up another issue: eDP Backlight Brightness LSB is at hex 0x723 or 
1827 decimal. You might also want to confirm your panel supports DPCD backlight 
adjustment by reading DPCD 0x701 and confirm bit 0 is set.

Clint

From: Intel-gfx <intel-gfx-boun...@lists.freedesktop.org> On Behalf Of John 
Sledge
Sent: Friday, May 25, 2018 1:11 AM
To: dri-devel@lists.freedesktop.org; Jani Nikula <jani.nik...@linux.intel.com>
Cc: intel-...@lists.freedesktop.org
Subject: Re: [Intel-gfx] DRM Inquiry

Hi Jani,

I seek 0-800 and here's what I get, all 11 0A in hex. Not sure if this is the 
brightness value of the display. I also did a test, when I disconnect the DP to 
the display and execute the dd commands, it would say error reading 
'dev/drm_dp_aux1': Connection timed out. So I think my display setup is okay 
and the 11 0A values are really coming out from the display.

Output in hex:
11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 
11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 
11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 
11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 11 0A 11 0A ....

int main(int argc, char **argv)
{
int ret = 0;
int offset = 0;
char call[100];
for(offset=0;offset<800;offset++)
{
sprintf(call,"dd if=/dev/drm_dp_aux1 bs=1 count=2 seek=%d >> out.txt",offset);
ret = system(call);
}
    return 0;
}
Regards,
John




On Friday, May 25, 2018, 2:56:04 PM GMT+8, Jani Nikula 
<jani.nik...@linux.intel.com<mailto:jani.nik...@linux.intel.com>> wrote:


On Fri, 25 May 2018, John Sledge 
<john_sled...@yahoo.com<mailto:john_sled...@yahoo.com>> wrote:
>  Hi Jani,
> I can now see /dev/drm_dp_aux*.
> I'm not familiar with dd command.Correct me if I'm wrong.
> Possible commands i tried and nothing happen:dd if=/dev/drm_dp_aux1 seek=723 
> ibs=2dd of=/dev/drm_dp_aux1 seek=723 ibs=2
> dd if=/dev/drm_dp_aux2 seek=723 ibs=2dd of=/dev/drm_dp_aux2 seek=723 ibs=2
> I assumed I could read the brightness msb and lsb using the define in 
> drm_dp_helper.h.
> #define DP_EDP_BACKLIGHT_BRIGHTNESS_MSB     0x722#define 
> DP_EDP_BACKLIGHT_BRIGHTNESS_LSB     0x723

You're mixing hex and decimal numbers, you should probably use bs=1
count=2, dd outputs binary so you probably need to pipe it to hexdump to
see anything, etc. Perhaps start experiments with reading at seek=0.

> 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.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.

It's a character device, open, seek, read/write. Don't try any ioctls on
it.

Good luck.


BR,

Jani.


>
> #define BRIGHTNESS 0x723
> int main(int argc, char ** argv){  int fd;  int retcode;  char out[128];    
> if((fd = open("/dev/drm_dp_aux1",O_RDWR)) >=0)  {    printf("open success");  
> }  else  {    printf("open failed");
>   }
>    if((retcode = ioctl(fd,BRIGHTNESS,&out)) < 0)  {    printf("ioctl 
> failed");  }  else  {    printf("ioctl success");
>   }
>   // trying aux2  if((fd = open("/dev/drm_dp_aux2",O_RDWR)) >=0)  {    
> printf("open success");  }  else  {    printf("open failed");
>   }
>   if((retcode = ioctl(fd,BRIGHTNESS,&out)) < 0)  {    printf("ioctl failed"); 
>  }  else  {    printf("ioctl success");
>   }
>   return 0;}
> Thanks,John
>
>    On Thursday, May 24, 2018, 8:38:02 PM GMT+8, Jani Nikula 
> <jani.nik...@linux.intel.com<mailto:jani.nik...@linux.intel.com>> wrote:
>
>  On Thu, 24 May 2018, John Sledge 
> <john_sled...@yahoo.com<mailto:john_sled...@yahoo.com>> wrote:
>> I was able to update my kernel to 4.6 which has the DRM_DP_AUX_CHARDEV
>> in the Kconfig file linux-4.6\drivers\gpu\drm. Though I also
>> add DRM_DP_AUX_CHARDEV=y in  kernel config. When invoke uname -r, I
>> could see that the kernel is now 4.6.
>
> If you're updating kernels, why not update to a recent kernel that's
> actually supported...?
>
>> How can I verify the DRM_DP_AUX_CHARDEV takes effect or got configure
>> it correctly?
>
> Boot the kernel, run 'ls /dev/drm_dp_aux*'. If you see stuff, you got it
> right.
>
>> It still unclear to me how to follow what you mean by using DRM DP AUX
>> interface and getting /dev/drm_dp_auxN node(s) that allows me to read
>> and write arbitrary DPCD offsets.
>
> The device is a char device you can open, seek to an offset (which would
> be the DPCD offset), and read. For testing, you can achieve the same
> using dd.
>
> BR,
> Jani.

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

Reply via email to