All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/bochs: add edid present check
@ 2018-12-20  6:50 ` Gerd Hoffmann
  0 siblings, 0 replies; 9+ messages in thread
From: Gerd Hoffmann @ 2018-12-20  6:50 UTC (permalink / raw)
  To: dri-devel
  Cc: andr2000, Gerd Hoffmann, David Airlie,
	open list:DRM DRIVER FOR BOCHS VIRTUAL GPU, open list

Check first two header bytes before trying to read the edid blob,
to avoid the log being spammed in case qemu has no edid support (old
qemu or edid turned off).

Fixes: 01f23459cf drm/bochs: add edid support.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 drivers/gpu/drm/bochs/bochs_hw.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c
index c90a0d492f..e1f8ffce00 100644
--- a/drivers/gpu/drm/bochs/bochs_hw.c
+++ b/drivers/gpu/drm/bochs/bochs_hw.c
@@ -89,6 +89,14 @@ int bochs_hw_load_edid(struct bochs_device *bochs)
 	if (!bochs->mmio)
 		return -1;
 
+	/*
+	 * Check first two EDID blob header bytes to figure whenever
+	 * edid support is enabled in qemu.
+	 */
+	if (readb(bochs->mmio + 0) != 0x00 ||
+	    readb(bochs->mmio + 1) != 0xff)
+		return -1;
+
 	kfree(bochs->edid);
 	bochs->edid = drm_do_get_edid(&bochs->connector,
 				      bochs_get_edid_block, bochs);
-- 
2.9.3


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

* [PATCH v2] drm/bochs: add edid present check
@ 2018-12-20  6:50 ` Gerd Hoffmann
  0 siblings, 0 replies; 9+ messages in thread
From: Gerd Hoffmann @ 2018-12-20  6:50 UTC (permalink / raw)
  To: dri-devel
  Cc: andr2000, Gerd Hoffmann, David Airlie,
	open list:DRM DRIVER FOR BOCHS VIRTUAL GPU, open list

Check first two header bytes before trying to read the edid blob,
to avoid the log being spammed in case qemu has no edid support (old
qemu or edid turned off).

Fixes: 01f23459cf drm/bochs: add edid support.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 drivers/gpu/drm/bochs/bochs_hw.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c
index c90a0d492f..e1f8ffce00 100644
--- a/drivers/gpu/drm/bochs/bochs_hw.c
+++ b/drivers/gpu/drm/bochs/bochs_hw.c
@@ -89,6 +89,14 @@ int bochs_hw_load_edid(struct bochs_device *bochs)
 	if (!bochs->mmio)
 		return -1;
 
+	/*
+	 * Check first two EDID blob header bytes to figure whenever
+	 * edid support is enabled in qemu.
+	 */
+	if (readb(bochs->mmio + 0) != 0x00 ||
+	    readb(bochs->mmio + 1) != 0xff)
+		return -1;
+
 	kfree(bochs->edid);
 	bochs->edid = drm_do_get_edid(&bochs->connector,
 				      bochs_get_edid_block, bochs);
-- 
2.9.3

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

* Re: [PATCH v2] drm/bochs: add edid present check
  2018-12-20  6:50 ` Gerd Hoffmann
@ 2018-12-20  8:28   ` Daniel Vetter
  -1 siblings, 0 replies; 9+ messages in thread
From: Daniel Vetter @ 2018-12-20  8:28 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: dri-devel, andr2000, David Airlie, open list,
	open list:DRM DRIVER FOR BOCHS VIRTUAL GPU

On Thu, Dec 20, 2018 at 07:50:01AM +0100, Gerd Hoffmann wrote:
> Check first two header bytes before trying to read the edid blob,
> to avoid the log being spammed in case qemu has no edid support (old
> qemu or edid turned off).
> 
> Fixes: 01f23459cf drm/bochs: add edid support.
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

It's a bit a hack, but makes sense.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/bochs/bochs_hw.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c
> index c90a0d492f..e1f8ffce00 100644
> --- a/drivers/gpu/drm/bochs/bochs_hw.c
> +++ b/drivers/gpu/drm/bochs/bochs_hw.c
> @@ -89,6 +89,14 @@ int bochs_hw_load_edid(struct bochs_device *bochs)
>  	if (!bochs->mmio)
>  		return -1;
>  
> +	/*
> +	 * Check first two EDID blob header bytes to figure whenever
> +	 * edid support is enabled in qemu.
> +	 */
> +	if (readb(bochs->mmio + 0) != 0x00 ||
> +	    readb(bochs->mmio + 1) != 0xff)
> +		return -1;
> +
>  	kfree(bochs->edid);
>  	bochs->edid = drm_do_get_edid(&bochs->connector,
>  				      bochs_get_edid_block, bochs);
> -- 
> 2.9.3
> 
> _______________________________________________
> 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

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

* Re: [PATCH v2] drm/bochs: add edid present check
  2018-12-20  6:50 ` Gerd Hoffmann
  (?)
  (?)
@ 2018-12-20  8:28 ` Daniel Vetter
  -1 siblings, 0 replies; 9+ messages in thread
From: Daniel Vetter @ 2018-12-20  8:28 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: andr2000, David Airlie, open list, dri-devel,
	open list:DRM DRIVER FOR BOCHS VIRTUAL GPU

On Thu, Dec 20, 2018 at 07:50:01AM +0100, Gerd Hoffmann wrote:
> Check first two header bytes before trying to read the edid blob,
> to avoid the log being spammed in case qemu has no edid support (old
> qemu or edid turned off).
> 
> Fixes: 01f23459cf drm/bochs: add edid support.
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

It's a bit a hack, but makes sense.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/bochs/bochs_hw.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c
> index c90a0d492f..e1f8ffce00 100644
> --- a/drivers/gpu/drm/bochs/bochs_hw.c
> +++ b/drivers/gpu/drm/bochs/bochs_hw.c
> @@ -89,6 +89,14 @@ int bochs_hw_load_edid(struct bochs_device *bochs)
>  	if (!bochs->mmio)
>  		return -1;
>  
> +	/*
> +	 * Check first two EDID blob header bytes to figure whenever
> +	 * edid support is enabled in qemu.
> +	 */
> +	if (readb(bochs->mmio + 0) != 0x00 ||
> +	    readb(bochs->mmio + 1) != 0xff)
> +		return -1;
> +
>  	kfree(bochs->edid);
>  	bochs->edid = drm_do_get_edid(&bochs->connector,
>  				      bochs_get_edid_block, bochs);
> -- 
> 2.9.3
> 
> _______________________________________________
> 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

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

* Re: [PATCH v2] drm/bochs: add edid present check
@ 2018-12-20  8:28   ` Daniel Vetter
  0 siblings, 0 replies; 9+ messages in thread
From: Daniel Vetter @ 2018-12-20  8:28 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: dri-devel, andr2000, David Airlie, open list,
	open list:DRM DRIVER FOR BOCHS VIRTUAL GPU

On Thu, Dec 20, 2018 at 07:50:01AM +0100, Gerd Hoffmann wrote:
> Check first two header bytes before trying to read the edid blob,
> to avoid the log being spammed in case qemu has no edid support (old
> qemu or edid turned off).
> 
> Fixes: 01f23459cf drm/bochs: add edid support.
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

It's a bit a hack, but makes sense.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/bochs/bochs_hw.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c
> index c90a0d492f..e1f8ffce00 100644
> --- a/drivers/gpu/drm/bochs/bochs_hw.c
> +++ b/drivers/gpu/drm/bochs/bochs_hw.c
> @@ -89,6 +89,14 @@ int bochs_hw_load_edid(struct bochs_device *bochs)
>  	if (!bochs->mmio)
>  		return -1;
>  
> +	/*
> +	 * Check first two EDID blob header bytes to figure whenever
> +	 * edid support is enabled in qemu.
> +	 */
> +	if (readb(bochs->mmio + 0) != 0x00 ||
> +	    readb(bochs->mmio + 1) != 0xff)
> +		return -1;
> +
>  	kfree(bochs->edid);
>  	bochs->edid = drm_do_get_edid(&bochs->connector,
>  				      bochs_get_edid_block, bochs);
> -- 
> 2.9.3
> 
> _______________________________________________
> 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

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

* Re: [PATCH v2] drm/bochs: add edid present check
  2018-12-20  8:28   ` Daniel Vetter
@ 2018-12-20  8:30     ` Daniel Vetter
  -1 siblings, 0 replies; 9+ messages in thread
From: Daniel Vetter @ 2018-12-20  8:30 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: dri-devel, andr2000, David Airlie, open list,
	open list:DRM DRIVER FOR BOCHS VIRTUAL GPU

On Thu, Dec 20, 2018 at 09:28:26AM +0100, Daniel Vetter wrote:
> On Thu, Dec 20, 2018 at 07:50:01AM +0100, Gerd Hoffmann wrote:
> > Check first two header bytes before trying to read the edid blob,
> > to avoid the log being spammed in case qemu has no edid support (old
> > qemu or edid turned off).
> > 
> > Fixes: 01f23459cf drm/bochs: add edid support.
> > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> 
> It's a bit a hack, but makes sense.

On 2nd thought, maybe make it less of a hack by reading all 8 bytes of the
header and checking it with drm_edit_is_valid().
-Daniel

> 
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > ---
> >  drivers/gpu/drm/bochs/bochs_hw.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c
> > index c90a0d492f..e1f8ffce00 100644
> > --- a/drivers/gpu/drm/bochs/bochs_hw.c
> > +++ b/drivers/gpu/drm/bochs/bochs_hw.c
> > @@ -89,6 +89,14 @@ int bochs_hw_load_edid(struct bochs_device *bochs)
> >  	if (!bochs->mmio)
> >  		return -1;
> >  
> > +	/*
> > +	 * Check first two EDID blob header bytes to figure whenever
> > +	 * edid support is enabled in qemu.
> > +	 */
> > +	if (readb(bochs->mmio + 0) != 0x00 ||
> > +	    readb(bochs->mmio + 1) != 0xff)
> > +		return -1;
> > +
> >  	kfree(bochs->edid);
> >  	bochs->edid = drm_do_get_edid(&bochs->connector,
> >  				      bochs_get_edid_block, bochs);
> > -- 
> > 2.9.3
> > 
> > _______________________________________________
> > 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

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* Re: [PATCH v2] drm/bochs: add edid present check
  2018-12-20  8:28   ` Daniel Vetter
  (?)
@ 2018-12-20  8:30   ` Daniel Vetter
  -1 siblings, 0 replies; 9+ messages in thread
From: Daniel Vetter @ 2018-12-20  8:30 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: andr2000, David Airlie, open list, dri-devel,
	open list:DRM DRIVER FOR BOCHS VIRTUAL GPU

On Thu, Dec 20, 2018 at 09:28:26AM +0100, Daniel Vetter wrote:
> On Thu, Dec 20, 2018 at 07:50:01AM +0100, Gerd Hoffmann wrote:
> > Check first two header bytes before trying to read the edid blob,
> > to avoid the log being spammed in case qemu has no edid support (old
> > qemu or edid turned off).
> > 
> > Fixes: 01f23459cf drm/bochs: add edid support.
> > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> 
> It's a bit a hack, but makes sense.

On 2nd thought, maybe make it less of a hack by reading all 8 bytes of the
header and checking it with drm_edit_is_valid().
-Daniel

> 
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > ---
> >  drivers/gpu/drm/bochs/bochs_hw.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c
> > index c90a0d492f..e1f8ffce00 100644
> > --- a/drivers/gpu/drm/bochs/bochs_hw.c
> > +++ b/drivers/gpu/drm/bochs/bochs_hw.c
> > @@ -89,6 +89,14 @@ int bochs_hw_load_edid(struct bochs_device *bochs)
> >  	if (!bochs->mmio)
> >  		return -1;
> >  
> > +	/*
> > +	 * Check first two EDID blob header bytes to figure whenever
> > +	 * edid support is enabled in qemu.
> > +	 */
> > +	if (readb(bochs->mmio + 0) != 0x00 ||
> > +	    readb(bochs->mmio + 1) != 0xff)
> > +		return -1;
> > +
> >  	kfree(bochs->edid);
> >  	bochs->edid = drm_do_get_edid(&bochs->connector,
> >  				      bochs_get_edid_block, bochs);
> > -- 
> > 2.9.3
> > 
> > _______________________________________________
> > 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

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* Re: [PATCH v2] drm/bochs: add edid present check
@ 2018-12-20  8:30     ` Daniel Vetter
  0 siblings, 0 replies; 9+ messages in thread
From: Daniel Vetter @ 2018-12-20  8:30 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: dri-devel, andr2000, David Airlie, open list,
	open list:DRM DRIVER FOR BOCHS VIRTUAL GPU

On Thu, Dec 20, 2018 at 09:28:26AM +0100, Daniel Vetter wrote:
> On Thu, Dec 20, 2018 at 07:50:01AM +0100, Gerd Hoffmann wrote:
> > Check first two header bytes before trying to read the edid blob,
> > to avoid the log being spammed in case qemu has no edid support (old
> > qemu or edid turned off).
> > 
> > Fixes: 01f23459cf drm/bochs: add edid support.
> > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> 
> It's a bit a hack, but makes sense.

On 2nd thought, maybe make it less of a hack by reading all 8 bytes of the
header and checking it with drm_edit_is_valid().
-Daniel

> 
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > ---
> >  drivers/gpu/drm/bochs/bochs_hw.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c
> > index c90a0d492f..e1f8ffce00 100644
> > --- a/drivers/gpu/drm/bochs/bochs_hw.c
> > +++ b/drivers/gpu/drm/bochs/bochs_hw.c
> > @@ -89,6 +89,14 @@ int bochs_hw_load_edid(struct bochs_device *bochs)
> >  	if (!bochs->mmio)
> >  		return -1;
> >  
> > +	/*
> > +	 * Check first two EDID blob header bytes to figure whenever
> > +	 * edid support is enabled in qemu.
> > +	 */
> > +	if (readb(bochs->mmio + 0) != 0x00 ||
> > +	    readb(bochs->mmio + 1) != 0xff)
> > +		return -1;
> > +
> >  	kfree(bochs->edid);
> >  	bochs->edid = drm_do_get_edid(&bochs->connector,
> >  				      bochs_get_edid_block, bochs);
> > -- 
> > 2.9.3
> > 
> > _______________________________________________
> > 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

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* [PATCH v2] drm/bochs: add edid present check
@ 2018-12-20  6:50 Gerd Hoffmann
  0 siblings, 0 replies; 9+ messages in thread
From: Gerd Hoffmann @ 2018-12-20  6:50 UTC (permalink / raw)
  To: dri-devel
  Cc: andr2000, David Airlie, open list,
	open list:DRM DRIVER FOR BOCHS VIRTUAL GPU

Check first two header bytes before trying to read the edid blob,
to avoid the log being spammed in case qemu has no edid support (old
qemu or edid turned off).

Fixes: 01f23459cf drm/bochs: add edid support.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 drivers/gpu/drm/bochs/bochs_hw.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c
index c90a0d492f..e1f8ffce00 100644
--- a/drivers/gpu/drm/bochs/bochs_hw.c
+++ b/drivers/gpu/drm/bochs/bochs_hw.c
@@ -89,6 +89,14 @@ int bochs_hw_load_edid(struct bochs_device *bochs)
 	if (!bochs->mmio)
 		return -1;
 
+	/*
+	 * Check first two EDID blob header bytes to figure whenever
+	 * edid support is enabled in qemu.
+	 */
+	if (readb(bochs->mmio + 0) != 0x00 ||
+	    readb(bochs->mmio + 1) != 0xff)
+		return -1;
+
 	kfree(bochs->edid);
 	bochs->edid = drm_do_get_edid(&bochs->connector,
 				      bochs_get_edid_block, bochs);
-- 
2.9.3

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

end of thread, other threads:[~2018-12-20  8:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-20  6:50 [PATCH v2] drm/bochs: add edid present check Gerd Hoffmann
2018-12-20  6:50 ` Gerd Hoffmann
2018-12-20  8:28 ` Daniel Vetter
2018-12-20  8:28   ` Daniel Vetter
2018-12-20  8:30   ` Daniel Vetter
2018-12-20  8:30   ` Daniel Vetter
2018-12-20  8:30     ` Daniel Vetter
2018-12-20  8:28 ` Daniel Vetter
  -- strict thread matches above, loose matches on Subject: below --
2018-12-20  6:50 Gerd Hoffmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.