Commit d2f112a5 authored by Christoph Niedermaier's avatar Christoph Niedermaier Committed by Jonathan Corbet

Docs/EDID: Fixed erroneous bits of XOFFSET, XPULSE, YOFFSET and YPULSE

The problem was found when EDID data sets for displays other
than the provided samples were generated. The patch has
no effect on the provided samples that still match the data
used in drivers/gpu/drm/drm_edid_load.c.

The provided samples use small values for XOFFSET, XPULSE,
YOFFSET and YPULSE, where the error doesn't occur. This fix
corrects the use of that values in case of high values, because
the most significant bits were treated incorrectly.

So in edid.S msbs4 should use bit 8 and 9 of XOFFSET and XPULS.
For YOFFSET and YPULSE msbs4 should use bit 4 and 5.

lsbs2 was introduced for a better overview, without
functional change.

Removing also the useless value 63 of all files, because
it is added in the *.S description files and then it is
subtracted in edid.S.
Signed-off-by: default avatarChristoph Niedermaier <cniedermaier@dh-electronics.de>
Reviewed-by: default avatarCarsten Emde <C.Emde@osadl.org>
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent 65102238
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
#define YBLANK 38 #define YBLANK 38
#define XOFFSET 8 #define XOFFSET 8
#define XPULSE 144 #define XPULSE 144
#define YOFFSET (63+3) #define YOFFSET 3
#define YPULSE (63+6) #define YPULSE 6
#define DPI 72 #define DPI 72
#define VFREQ 60 /* Hz */ #define VFREQ 60 /* Hz */
#define TIMING_NAME "Linux XGA" #define TIMING_NAME "Linux XGA"
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
#define YBLANK 42 #define YBLANK 42
#define XOFFSET 48 #define XOFFSET 48
#define XPULSE 112 #define XPULSE 112
#define YOFFSET (63+1) #define YOFFSET 1
#define YPULSE (63+3) #define YPULSE 3
#define DPI 72 #define DPI 72
#define VFREQ 60 /* Hz */ #define VFREQ 60 /* Hz */
#define TIMING_NAME "Linux SXGA" #define TIMING_NAME "Linux SXGA"
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
#define YBLANK 50 #define YBLANK 50
#define XOFFSET 64 #define XOFFSET 64
#define XPULSE 192 #define XPULSE 192
#define YOFFSET (63+1) #define YOFFSET 1
#define YPULSE (63+3) #define YPULSE 3
#define DPI 72 #define DPI 72
#define VFREQ 60 /* Hz */ #define VFREQ 60 /* Hz */
#define TIMING_NAME "Linux UXGA" #define TIMING_NAME "Linux UXGA"
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
#define YBLANK 39 #define YBLANK 39
#define XOFFSET 104 #define XOFFSET 104
#define XPULSE 176 #define XPULSE 176
#define YOFFSET (63+3) #define YOFFSET 3
#define YPULSE (63+6) #define YPULSE 6
#define DPI 96 #define DPI 96
#define VFREQ 60 /* Hz */ #define VFREQ 60 /* Hz */
#define TIMING_NAME "Linux WSXGA" #define TIMING_NAME "Linux WSXGA"
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
#define YBLANK 45 #define YBLANK 45
#define XOFFSET 88 #define XOFFSET 88
#define XPULSE 44 #define XPULSE 44
#define YOFFSET (63+4) #define YOFFSET 4
#define YPULSE (63+5) #define YPULSE 5
#define DPI 96 #define DPI 96
#define VFREQ 60 /* Hz */ #define VFREQ 60 /* Hz */
#define TIMING_NAME "Linux FHD" #define TIMING_NAME "Linux FHD"
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
#define YBLANK 28 #define YBLANK 28
#define XOFFSET 40 #define XOFFSET 40
#define XPULSE 128 #define XPULSE 128
#define YOFFSET (63+1) #define YOFFSET 1
#define YPULSE (63+4) #define YPULSE 4
#define DPI 72 #define DPI 72
#define VFREQ 60 /* Hz */ #define VFREQ 60 /* Hz */
#define TIMING_NAME "Linux SVGA" #define TIMING_NAME "Linux SVGA"
......
...@@ -45,8 +45,8 @@ EDID: ...@@ -45,8 +45,8 @@ EDID:
#define YPIX vdisp #define YPIX vdisp
#define YBLANK vtotal-vdisp #define YBLANK vtotal-vdisp
#define YOFFSET (63+(vsyncstart-vdisp)) #define YOFFSET vsyncstart-vdisp
#define YPULSE (63+(vsyncend-vsyncstart)) #define YPULSE vsyncend-vsyncstart
The CRC value in the last line The CRC value in the last line
#define CRC 0x55 #define CRC 0x55
......
...@@ -47,9 +47,11 @@ ...@@ -47,9 +47,11 @@
#define mfgname2id(v1,v2,v3) \ #define mfgname2id(v1,v2,v3) \
((((v1-'@')&0x1f)<<10)+(((v2-'@')&0x1f)<<5)+((v3-'@')&0x1f)) ((((v1-'@')&0x1f)<<10)+(((v2-'@')&0x1f)<<5)+((v3-'@')&0x1f))
#define swap16(v1) ((v1>>8)+((v1&0xff)<<8)) #define swap16(v1) ((v1>>8)+((v1&0xff)<<8))
#define lsbs2(v1,v2) (((v1&0x0f)<<4)+(v2&0x0f))
#define msbs2(v1,v2) ((((v1>>8)&0x0f)<<4)+((v2>>8)&0x0f)) #define msbs2(v1,v2) ((((v1>>8)&0x0f)<<4)+((v2>>8)&0x0f))
#define msbs4(v1,v2,v3,v4) \ #define msbs4(v1,v2,v3,v4) \
(((v1&0x03)>>2)+((v2&0x03)>>4)+((v3&0x03)>>6)+((v4&0x03)>>8)) ((((v1>>8)&0x03)<<6)+(((v2>>8)&0x03)<<4)+\
(((v3>>4)&0x03)<<2)+((v4>>4)&0x03))
#define pixdpi2mm(pix,dpi) ((pix*25)/dpi) #define pixdpi2mm(pix,dpi) ((pix*25)/dpi)
#define xsize pixdpi2mm(XPIX,DPI) #define xsize pixdpi2mm(XPIX,DPI)
#define ysize pixdpi2mm(YPIX,DPI) #define ysize pixdpi2mm(YPIX,DPI)
...@@ -200,9 +202,9 @@ y_msbs: .byte msbs2(YPIX,YBLANK) ...@@ -200,9 +202,9 @@ y_msbs: .byte msbs2(YPIX,YBLANK)
x_snc_off_lsb: .byte XOFFSET&0xff x_snc_off_lsb: .byte XOFFSET&0xff
/* Horizontal sync pulse width pixels 8 lsbits (0-1023) */ /* Horizontal sync pulse width pixels 8 lsbits (0-1023) */
x_snc_pls_lsb: .byte XPULSE&0xff x_snc_pls_lsb: .byte XPULSE&0xff
/* Bits 7-4 Vertical sync offset lines 4 lsbits -63) /* Bits 7-4 Vertical sync offset lines 4 lsbits (0-63)
Bits 3-0 Vertical sync pulse width lines 4 lsbits -63) */ Bits 3-0 Vertical sync pulse width lines 4 lsbits (0-63) */
y_snc_lsb: .byte ((YOFFSET-63)<<4)+(YPULSE-63) y_snc_lsb: .byte lsbs2(YOFFSET, YPULSE)
/* Bits 7-6 Horizontal sync offset pixels 2 msbits /* Bits 7-6 Horizontal sync offset pixels 2 msbits
Bits 5-4 Horizontal sync pulse width pixels 2 msbits Bits 5-4 Horizontal sync pulse width pixels 2 msbits
Bits 3-2 Vertical sync offset lines 2 msbits Bits 3-2 Vertical sync offset lines 2 msbits
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment