dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] drm: use .hword to represent 16-bit numbers
@ 2017-03-29 13:45 Javi Merino
  2017-03-30  8:15 ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Javi Merino @ 2017-03-29 13:45 UTC (permalink / raw)
  To: airlied, C.Emde
  Cc: Jani Nikula, dri-devel, linux-kernel, linux-kernel, Javi Merino

The size of .word is the size of a word in the given platform, which
for intel systems is 16-bits but other architectures use different
sizes.  However, .hword emits 16-bit numbers regardless of the
platform (and despite the name).  The quantities specified in EDID are
platform independent, so they should work in spite of the default
target of the cc you are using, so use .hword where EDID specifies
16-bit numbers.

Cc: Carsten Emde <C.Emde@osadl.org>
Cc: David Airlie <airlied@linux.ie>
Signed-off-by: Javi Merino <javi.merino@kernel.org>
---
 Documentation/EDID/edid.S | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/EDID/edid.S b/Documentation/EDID/edid.S
index 7ac0327..ef082dc 100644
--- a/Documentation/EDID/edid.S
+++ b/Documentation/EDID/edid.S
@@ -59,9 +59,9 @@
 /* Fixed header pattern */
 header:		.byte	0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00
 
-mfg_id:		.word	swap16(mfgname2id(MFG_LNX1, MFG_LNX2, MFG_LNX3))
+mfg_id:		.hword	swap16(mfgname2id(MFG_LNX1, MFG_LNX2, MFG_LNX3))
 
-prod_code:	.word	0
+prod_code:	.hword	0
 
 /* Serial number. 32 bits, little endian. */
 serial_number:	.long	SERIAL
@@ -177,7 +177,7 @@ std_vres:	.byte	(XY_RATIO<<6)+VFREQ-60
 
 descriptor1:
 /* Pixel clock in 10 kHz units. (0.-655.35 MHz, little-endian) */
-clock:		.word	CLOCK/10
+clock:		.hword	CLOCK/10
 
 /* Horizontal active pixels 8 lsbits (0-4095) */
 x_act_lsb:	.byte	XPIX&0xff
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH RESEND] drm: use .hword to represent 16-bit numbers
  2017-03-29 13:45 [PATCH RESEND] drm: use .hword to represent 16-bit numbers Javi Merino
@ 2017-03-30  8:15 ` Daniel Vetter
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2017-03-30  8:15 UTC (permalink / raw)
  To: Javi Merino; +Cc: linux-kernel, linux-kernel, dri-devel

On Wed, Mar 29, 2017 at 02:45:23PM +0100, Javi Merino wrote:
> The size of .word is the size of a word in the given platform, which
> for intel systems is 16-bits but other architectures use different
> sizes.  However, .hword emits 16-bit numbers regardless of the
> platform (and despite the name).  The quantities specified in EDID are
> platform independent, so they should work in spite of the default
> target of the cc you are using, so use .hword where EDID specifies
> 16-bit numbers.
> 
> Cc: Carsten Emde <C.Emde@osadl.org>
> Cc: David Airlie <airlied@linux.ie>
> Signed-off-by: Javi Merino <javi.merino@kernel.org>

Applied to drm-misc, thanks.
-Daniel

> ---
>  Documentation/EDID/edid.S | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/EDID/edid.S b/Documentation/EDID/edid.S
> index 7ac0327..ef082dc 100644
> --- a/Documentation/EDID/edid.S
> +++ b/Documentation/EDID/edid.S
> @@ -59,9 +59,9 @@
>  /* Fixed header pattern */
>  header:		.byte	0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00
>  
> -mfg_id:		.word	swap16(mfgname2id(MFG_LNX1, MFG_LNX2, MFG_LNX3))
> +mfg_id:		.hword	swap16(mfgname2id(MFG_LNX1, MFG_LNX2, MFG_LNX3))
>  
> -prod_code:	.word	0
> +prod_code:	.hword	0
>  
>  /* Serial number. 32 bits, little endian. */
>  serial_number:	.long	SERIAL
> @@ -177,7 +177,7 @@ std_vres:	.byte	(XY_RATIO<<6)+VFREQ-60
>  
>  descriptor1:
>  /* Pixel clock in 10 kHz units. (0.-655.35 MHz, little-endian) */
> -clock:		.word	CLOCK/10
> +clock:		.hword	CLOCK/10
>  
>  /* Horizontal active pixels 8 lsbits (0-4095) */
>  x_act_lsb:	.byte	XPIX&0xff
> -- 
> 2.1.4
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-30  8:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-29 13:45 [PATCH RESEND] drm: use .hword to represent 16-bit numbers Javi Merino
2017-03-30  8:15 ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).