linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Documentation/EDID fixes
@ 2017-03-06 14:27 Javi Merino
  2017-03-06 14:27 ` [PATCH 1/2] drm: use .hword to represent 16-bit numbers Javi Merino
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Javi Merino @ 2017-03-06 14:27 UTC (permalink / raw)
  To: airlied, C.Emde; +Cc: dri-devel, linux-kernel, linux-kernel, Javi Merino

Hi,

I found these two minor issues while building an EDID.  I'm not sure
whether the second patch (Add O= to support) is upstream material, but
I'm sending it just in case.

Thanks,
Javi

Javi Merino (2):
  drm: use .hword to represent 16-bit numbers
  drm: Add O= support

 Documentation/EDID/Makefile | 21 ++++++++++++---------
 Documentation/EDID/edid.S   |  6 +++---
 2 files changed, 15 insertions(+), 12 deletions(-)

-- 
2.1.4

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

* [PATCH 1/2] drm: use .hword to represent 16-bit numbers
  2017-03-06 14:27 [PATCH 0/2] Documentation/EDID fixes Javi Merino
@ 2017-03-06 14:27 ` Javi Merino
  2017-03-06 14:27 ` [PATCH 2/2] drm: Add O= support Javi Merino
  2017-03-07 16:16 ` [PATCH 0/2] Documentation/EDID fixes Jani Nikula
  2 siblings, 0 replies; 6+ messages in thread
From: Javi Merino @ 2017-03-06 14:27 UTC (permalink / raw)
  To: airlied, C.Emde; +Cc: 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] 6+ messages in thread

* [PATCH 2/2] drm: Add O= support
  2017-03-06 14:27 [PATCH 0/2] Documentation/EDID fixes Javi Merino
  2017-03-06 14:27 ` [PATCH 1/2] drm: use .hword to represent 16-bit numbers Javi Merino
@ 2017-03-06 14:27 ` Javi Merino
  2017-03-07 16:16 ` [PATCH 0/2] Documentation/EDID fixes Jani Nikula
  2 siblings, 0 replies; 6+ messages in thread
From: Javi Merino @ 2017-03-06 14:27 UTC (permalink / raw)
  To: airlied, C.Emde; +Cc: dri-devel, linux-kernel, linux-kernel, Javi Merino

Add an option to put all output files in a given directory, similar to
what kbuild does.

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

diff --git a/Documentation/EDID/Makefile b/Documentation/EDID/Makefile
index 17763ca..76e8ef5 100644
--- a/Documentation/EDID/Makefile
+++ b/Documentation/EDID/Makefile
@@ -1,26 +1,29 @@
 
+# use "make O=dir" to locate all output files in "dir"
+O ?= .
+
 SOURCES	:= $(wildcard [0-9]*x[0-9]*.S)
 
-BIN	:= $(patsubst %.S, %.bin, $(SOURCES))
+BIN	:= $(patsubst %.S, $(O)/%.bin, $(SOURCES))
 
-IHEX	:= $(patsubst %.S, %.bin.ihex, $(SOURCES))
+IHEX	:= $(patsubst %.S, $(O)/%.bin.ihex, $(SOURCES))
 
-CODE	:= $(patsubst %.S, %.c, $(SOURCES))
+CODE	:= $(patsubst %.S, $(O)/%.c, $(SOURCES))
 
 all:	$(BIN) $(IHEX) $(CODE)
 
 clean:
-	@rm -f *.o *.bin.ihex *.bin *.c
+	@rm -f $(O)/*.o $(O)/*.bin.ihex $(O)/*.bin $(O)/*.c
 
-%.o:	%.S
-	@cc -c $^
+$(O)/%.o:	%.S
+	@cc -c $^ -o $@
 
-%.bin:	%.o
+$(O)/%.bin:	$(O)/%.o
 	@objcopy -Obinary $^ $@
 
-%.bin.ihex:	%.o
+$(O)/%.bin.ihex:	$(O)/%.o
 	@objcopy -Oihex $^ $@
 	@dos2unix $@ 2>/dev/null
 
-%.c:	%.bin
+$(O)/%.c:	$(O)/%.bin
 	@echo "{" >$@; hexdump -f hex $^ >>$@; echo "};" >>$@
-- 
2.1.4

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

* Re: [PATCH 0/2] Documentation/EDID fixes
  2017-03-06 14:27 [PATCH 0/2] Documentation/EDID fixes Javi Merino
  2017-03-06 14:27 ` [PATCH 1/2] drm: use .hword to represent 16-bit numbers Javi Merino
  2017-03-06 14:27 ` [PATCH 2/2] drm: Add O= support Javi Merino
@ 2017-03-07 16:16 ` Jani Nikula
  2017-03-07 16:33   ` Javi Merino
  2 siblings, 1 reply; 6+ messages in thread
From: Jani Nikula @ 2017-03-07 16:16 UTC (permalink / raw)
  To: Javi Merino, airlied, C.Emde
  Cc: linux-kernel, Javi Merino, linux-kernel, dri-devel

On Mon, 06 Mar 2017, Javi Merino <javi.merino@kernel.org> wrote:
> I found these two minor issues while building an EDID.  I'm not sure
> whether the second patch (Add O= to support) is upstream material, but
> I'm sending it just in case.

I'm not opposed to fixing existing issues like this, but really I think
there should be an userspace tool for this. Definitely outside of the
Documentation directory, perhaps even outside the kernel tree
altogether.

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Technology Center

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

* Re: [PATCH 0/2] Documentation/EDID fixes
  2017-03-07 16:16 ` [PATCH 0/2] Documentation/EDID fixes Jani Nikula
@ 2017-03-07 16:33   ` Javi Merino
  2017-03-08  8:11     ` Jani Nikula
  0 siblings, 1 reply; 6+ messages in thread
From: Javi Merino @ 2017-03-07 16:33 UTC (permalink / raw)
  To: Jani Nikula; +Cc: airlied, C.Emde, linux-kernel, linux-kernel, dri-devel

On Tue, Mar 07, 2017 at 06:16:51PM +0200, Jani Nikula wrote:
> On Mon, 06 Mar 2017, Javi Merino <javi.merino@kernel.org> wrote:
> > I found these two minor issues while building an EDID.  I'm not sure
> > whether the second patch (Add O= to support) is upstream material, but
> > I'm sending it just in case.
> 
> I'm not opposed to fixing existing issues like this, but really I think
> there should be an userspace tool for this. Definitely outside of the
> Documentation directory, perhaps even outside the kernel tree
> altogether.

I am not sure whether this should be in the kernel or not, but I
agree that Documentation/ doesn't look like the right place to build
these files.

Cheers,
Javi

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

* Re: [PATCH 0/2] Documentation/EDID fixes
  2017-03-07 16:33   ` Javi Merino
@ 2017-03-08  8:11     ` Jani Nikula
  0 siblings, 0 replies; 6+ messages in thread
From: Jani Nikula @ 2017-03-08  8:11 UTC (permalink / raw)
  To: Javi Merino; +Cc: airlied, C.Emde, linux-kernel, linux-kernel, dri-devel

On Tue, 07 Mar 2017, Javi Merino <javi.merino@kernel.org> wrote:
> On Tue, Mar 07, 2017 at 06:16:51PM +0200, Jani Nikula wrote:
>> On Mon, 06 Mar 2017, Javi Merino <javi.merino@kernel.org> wrote:
>> > I found these two minor issues while building an EDID.  I'm not sure
>> > whether the second patch (Add O= to support) is upstream material, but
>> > I'm sending it just in case.
>> 
>> I'm not opposed to fixing existing issues like this, but really I think
>> there should be an userspace tool for this. Definitely outside of the
>> Documentation directory, perhaps even outside the kernel tree
>> altogether.
>
> I am not sure whether this should be in the kernel or not, but I
> agree that Documentation/ doesn't look like the right place to build
> these files.

Just so there's no confusion: I'm just saying what I think should be
done in the long run. I'm not opposed to the fixes at hand, but someone
else needs to review them.

BR,
Jani.

-- 
Jani Nikula, Intel Open Source Technology Center

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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-06 14:27 [PATCH 0/2] Documentation/EDID fixes Javi Merino
2017-03-06 14:27 ` [PATCH 1/2] drm: use .hword to represent 16-bit numbers Javi Merino
2017-03-06 14:27 ` [PATCH 2/2] drm: Add O= support Javi Merino
2017-03-07 16:16 ` [PATCH 0/2] Documentation/EDID fixes Jani Nikula
2017-03-07 16:33   ` Javi Merino
2017-03-08  8:11     ` Jani Nikula

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