All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl
@ 2018-09-04 20:53 Chris Wilson
  2018-09-04 21:23 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: Chris Wilson @ 2018-09-04 20:53 UTC (permalink / raw)
  To: dri-devel; +Cc: Daniel Vetter, intel-gfx

Since this is handling user provided bpp and depth, we need to sanity
check and propagate the EINVAL back rather than assume what the insane
client intended and fill the logs with DRM_ERROR.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
So I am presuming that r.pixel_format == 0 is rejected elsewhere for the
internal users (as if any would deliberately provoke the error)!
---
 drivers/gpu/drm/drm_fourcc.c      | 4 ++--
 drivers/gpu/drm/drm_framebuffer.c | 5 ++++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c
index 35c1e2742c27..34595c5b55c9 100644
--- a/drivers/gpu/drm/drm_fourcc.c
+++ b/drivers/gpu/drm/drm_fourcc.c
@@ -69,8 +69,8 @@ uint32_t drm_mode_legacy_fb_format(uint32_t bpp, uint32_t depth)
 			fmt = DRM_FORMAT_ARGB8888;
 		break;
 	default:
-		DRM_ERROR("bad bpp, assuming x8r8g8b8 pixel format\n");
-		fmt = DRM_FORMAT_XRGB8888;
+		DRM_DEBUG("bad bpp [%d] and depth [%d]\n", bpp, depth);
+		fmt = 0;
 		break;
 	}
 
diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c
index 781af1d42d76..7641bddfe367 100644
--- a/drivers/gpu/drm/drm_framebuffer.c
+++ b/drivers/gpu/drm/drm_framebuffer.c
@@ -112,12 +112,15 @@ int drm_mode_addfb(struct drm_device *dev, struct drm_mode_fb_cmd *or,
 	struct drm_mode_fb_cmd2 r = {};
 	int ret;
 
+	r.pixel_format = drm_mode_legacy_fb_format(or->bpp, or->depth);
+	if (!r.pixel_format)
+		return -EINVAL;
+
 	/* convert to new format and call new ioctl */
 	r.fb_id = or->fb_id;
 	r.width = or->width;
 	r.height = or->height;
 	r.pitches[0] = or->pitch;
-	r.pixel_format = drm_mode_legacy_fb_format(or->bpp, or->depth);
 	r.handles[0] = or->handle;
 
 	if (r.pixel_format == DRM_FORMAT_XRGB2101010 &&
-- 
2.19.0.rc1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.BAT: success for drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl
  2018-09-04 20:53 [PATCH] drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl Chris Wilson
@ 2018-09-04 21:23 ` Patchwork
  2018-09-04 21:46 ` [PATCH] " Daniel Vetter
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2018-09-04 21:23 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl
URL   : https://patchwork.freedesktop.org/series/49150/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4769 -> Patchwork_10085 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/49150/revisions/1/mbox/

== Known issues ==

  Here are the changes found in Patchwork_10085 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_exec_suspend@basic-s3:
      fi-kbl-soraka:      NOTRUN -> INCOMPLETE (fdo#107556, fdo#107774)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      fi-glk-dsi:         PASS -> INCOMPLETE (k.org#198133, fdo#103359)
      fi-byt-clapper:     PASS -> FAIL (fdo#103191, fdo#107362)

    
    ==== Possible fixes ====

    igt@drv_module_reload@basic-reload:
      fi-blb-e6850:       INCOMPLETE (fdo#107718) -> PASS

    igt@kms_flip@basic-plain-flip:
      fi-ilk-650:         DMESG-WARN (fdo#106387) -> PASS +2

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
      fi-bdw-samus:       DMESG-WARN (fdo#107494) -> PASS

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      fi-cnl-psr:         DMESG-WARN (fdo#104951) -> PASS

    
  fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
  fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
  fdo#104951 https://bugs.freedesktop.org/show_bug.cgi?id=104951
  fdo#106387 https://bugs.freedesktop.org/show_bug.cgi?id=106387
  fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
  fdo#107494 https://bugs.freedesktop.org/show_bug.cgi?id=107494
  fdo#107556 https://bugs.freedesktop.org/show_bug.cgi?id=107556
  fdo#107718 https://bugs.freedesktop.org/show_bug.cgi?id=107718
  fdo#107774 https://bugs.freedesktop.org/show_bug.cgi?id=107774
  k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133


== Participating hosts (48 -> 45) ==

  Additional (2): fi-kbl-soraka fi-pnv-d510 
  Missing    (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-hsw-4200u 


== Build changes ==

    * Linux: CI_DRM_4769 -> Patchwork_10085

  CI_DRM_4769: ced90ae07f3004a5fe83f26bc8f2205340b9b5a8 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4627: e0c3033a57d85c0d2eb33af0451afa16edc79f10 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10085: 98e6d2db475f03e2baa8818a7bc12d0490a6e961 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

98e6d2db475f drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10085/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl
  2018-09-04 20:53 [PATCH] drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl Chris Wilson
  2018-09-04 21:23 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2018-09-04 21:46 ` Daniel Vetter
  2018-09-05 10:10   ` Chris Wilson
  2018-09-05  4:16 ` ✓ Fi.CI.IGT: success for " Patchwork
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 14+ messages in thread
From: Daniel Vetter @ 2018-09-04 21:46 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Daniel Vetter, intel-gfx, dri-devel

On Tue, Sep 04, 2018 at 09:53:19PM +0100, Chris Wilson wrote:
> Since this is handling user provided bpp and depth, we need to sanity
> check and propagate the EINVAL back rather than assume what the insane
> client intended and fill the logs with DRM_ERROR.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> So I am presuming that r.pixel_format == 0 is rejected elsewhere for the
> internal users (as if any would deliberately provoke the error)!

Could maybe add a DRM_FORMAT_INVALID at the end of drm_fourcc.h, and then
switch over the various format/modifier tables to being zero terminated.
Well DRM_FORMAT_MOD_INVALID can't be 0 because that means linear. Anyway,
I digress, this loks good.

And yes drm_internal_framebuffer_create makes sure you have a real fourcc
code, not a figment of your imagination (or more profane, stack garbage).

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Same as with the previous one, igt would be sweet on top.
-Daniel

> ---
>  drivers/gpu/drm/drm_fourcc.c      | 4 ++--
>  drivers/gpu/drm/drm_framebuffer.c | 5 ++++-
>  2 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c
> index 35c1e2742c27..34595c5b55c9 100644
> --- a/drivers/gpu/drm/drm_fourcc.c
> +++ b/drivers/gpu/drm/drm_fourcc.c
> @@ -69,8 +69,8 @@ uint32_t drm_mode_legacy_fb_format(uint32_t bpp, uint32_t depth)
>  			fmt = DRM_FORMAT_ARGB8888;
>  		break;
>  	default:
> -		DRM_ERROR("bad bpp, assuming x8r8g8b8 pixel format\n");
> -		fmt = DRM_FORMAT_XRGB8888;
> +		DRM_DEBUG("bad bpp [%d] and depth [%d]\n", bpp, depth);
> +		fmt = 0;
>  		break;
>  	}
>  
> diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c
> index 781af1d42d76..7641bddfe367 100644
> --- a/drivers/gpu/drm/drm_framebuffer.c
> +++ b/drivers/gpu/drm/drm_framebuffer.c
> @@ -112,12 +112,15 @@ int drm_mode_addfb(struct drm_device *dev, struct drm_mode_fb_cmd *or,
>  	struct drm_mode_fb_cmd2 r = {};
>  	int ret;
>  
> +	r.pixel_format = drm_mode_legacy_fb_format(or->bpp, or->depth);
> +	if (!r.pixel_format)
> +		return -EINVAL;
> +
>  	/* convert to new format and call new ioctl */
>  	r.fb_id = or->fb_id;
>  	r.width = or->width;
>  	r.height = or->height;
>  	r.pitches[0] = or->pitch;
> -	r.pixel_format = drm_mode_legacy_fb_format(or->bpp, or->depth);
>  	r.handles[0] = or->handle;
>  
>  	if (r.pixel_format == DRM_FORMAT_XRGB2101010 &&
> -- 
> 2.19.0.rc1
> 

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

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

* ✓ Fi.CI.IGT: success for drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl
  2018-09-04 20:53 [PATCH] drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl Chris Wilson
  2018-09-04 21:23 ` ✓ Fi.CI.BAT: success for " Patchwork
  2018-09-04 21:46 ` [PATCH] " Daniel Vetter
@ 2018-09-05  4:16 ` Patchwork
  2018-09-05 10:22 ` [PATCH] drm: Reject unknown legacy bpp and depth " Chris Wilson
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2018-09-05  4:16 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl
URL   : https://patchwork.freedesktop.org/series/49150/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4769_full -> Patchwork_10085_full =

== Summary - SUCCESS ==

  No regressions found.

  

== Known issues ==

  Here are the changes found in Patchwork_10085_full that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_suspend@forcewake:
      shard-apl:          PASS -> INCOMPLETE (fdo#103927)

    igt@kms_busy@extended-modeset-hang-newfb-render-b:
      shard-glk:          PASS -> INCOMPLETE (k.org#198133, fdo#103359)

    igt@kms_cursor_legacy@cursor-vs-flip-toggle:
      shard-hsw:          PASS -> FAIL (fdo#103355)

    igt@kms_flip@flip-vs-expired-vblank-interruptible:
      shard-glk:          PASS -> FAIL (fdo#105363, fdo#102887)

    
    ==== Possible fixes ====

    igt@drv_suspend@shrink:
      shard-snb:          FAIL (fdo#106886) -> PASS

    igt@kms_flip@absolute-wf_vblank:
      shard-kbl:          DMESG-WARN (fdo#105602, fdo#103558) -> PASS +25

    igt@kms_flip@flip-vs-modeset-vs-hang:
      shard-kbl:          DMESG-WARN (fdo#105602, fdo#103313, fdo#103558) -> PASS

    igt@kms_frontbuffer_tracking@fbc-rgb565-draw-mmap-gtt:
      shard-glk:          FAIL (fdo#103167) -> PASS

    igt@kms_setmode@basic:
      shard-apl:          FAIL (fdo#99912) -> PASS

    
  fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103313 https://bugs.freedesktop.org/show_bug.cgi?id=103313
  fdo#103355 https://bugs.freedesktop.org/show_bug.cgi?id=103355
  fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
  fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
  fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
  fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
  fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
  fdo#106886 https://bugs.freedesktop.org/show_bug.cgi?id=106886
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
  k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133


== Participating hosts (5 -> 5) ==

  No changes in participating hosts


== Build changes ==

    * Linux: CI_DRM_4769 -> Patchwork_10085

  CI_DRM_4769: ced90ae07f3004a5fe83f26bc8f2205340b9b5a8 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4627: e0c3033a57d85c0d2eb33af0451afa16edc79f10 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10085: 98e6d2db475f03e2baa8818a7bc12d0490a6e961 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10085/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl
  2018-09-04 21:46 ` [PATCH] " Daniel Vetter
@ 2018-09-05 10:10   ` Chris Wilson
  0 siblings, 0 replies; 14+ messages in thread
From: Chris Wilson @ 2018-09-05 10:10 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, intel-gfx, dri-devel

Quoting Daniel Vetter (2018-09-04 22:46:33)
> On Tue, Sep 04, 2018 at 09:53:19PM +0100, Chris Wilson wrote:
> > Since this is handling user provided bpp and depth, we need to sanity
> > check and propagate the EINVAL back rather than assume what the insane
> > client intended and fill the logs with DRM_ERROR.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > So I am presuming that r.pixel_format == 0 is rejected elsewhere for the
> > internal users (as if any would deliberately provoke the error)!
> 
> Could maybe add a DRM_FORMAT_INVALID at the end of drm_fourcc.h, and then
> switch over the various format/modifier tables to being zero terminated.
> Well DRM_FORMAT_MOD_INVALID can't be 0 because that means linear. Anyway,
> I digress, this loks good.
> 
> And yes drm_internal_framebuffer_create makes sure you have a real fourcc
> code, not a figment of your imagination (or more profane, stack garbage).
> 
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> Same as with the previous one, igt would be sweet on top.

And the first thing one does with the test case is realise that we never
check that depth is valid for the bpp based pixel format.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH] drm: Reject unknown legacy bpp and depth for drm_mode_addfb ioctl
  2018-09-04 20:53 [PATCH] drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl Chris Wilson
                   ` (2 preceding siblings ...)
  2018-09-05  4:16 ` ✓ Fi.CI.IGT: success for " Patchwork
@ 2018-09-05 10:22 ` Chris Wilson
  2018-09-05 10:29   ` Chris Wilson
                     ` (2 more replies)
  2018-09-05 11:55 ` ✓ Fi.CI.BAT: success for drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl (rev2) Patchwork
                   ` (3 subsequent siblings)
  7 siblings, 3 replies; 14+ messages in thread
From: Chris Wilson @ 2018-09-05 10:22 UTC (permalink / raw)
  To: dri-devel; +Cc: Daniel Vetter, intel-gfx

Since this is handling user provided bpp and depth, we need to sanity
check and propagate the EINVAL back rather than assume what the insane
client intended and fill the logs with DRM_ERROR.

v2: Check both bpp and depth match the builtin pixel format, and
introduce a canonical DRM_FORMAT_INVALID to reserve 0 against any future
fourcc.

Testcase: igt/kms_addfb_basic/legacy-format
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_fourcc.c      | 33 +++++++++++++++++++++----------
 drivers/gpu/drm/drm_framebuffer.c |  7 ++++++-
 include/uapi/drm/drm_fourcc.h     |  3 +++
 3 files changed, 32 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c
index 35c1e2742c27..d9dadbc43327 100644
--- a/drivers/gpu/drm/drm_fourcc.c
+++ b/drivers/gpu/drm/drm_fourcc.c
@@ -45,32 +45,45 @@ static char printable_char(int c)
  */
 uint32_t drm_mode_legacy_fb_format(uint32_t bpp, uint32_t depth)
 {
-	uint32_t fmt;
+	uint32_t fmt = DRM_FORMAT_INVALID;
 
 	switch (bpp) {
 	case 8:
-		fmt = DRM_FORMAT_C8;
+		if (depth == 0)
+			fmt = DRM_FORMAT_C8;
 		break;
 	case 16:
-		if (depth == 15)
+		switch (depth) {
+		case 15:
 			fmt = DRM_FORMAT_XRGB1555;
-		else
+			break;
+		case 16:
 			fmt = DRM_FORMAT_RGB565;
+			break;
+		default:
+			break;
+		}
 		break;
 	case 24:
-		fmt = DRM_FORMAT_RGB888;
+		if (depth == 24)
+			fmt = DRM_FORMAT_RGB888;
 		break;
 	case 32:
-		if (depth == 24)
+		switch (depth) {
+		case 24:
 			fmt = DRM_FORMAT_XRGB8888;
-		else if (depth == 30)
+			break;
+		case 30:
 			fmt = DRM_FORMAT_XRGB2101010;
-		else
+			break;
+		case 32:
 			fmt = DRM_FORMAT_ARGB8888;
+			break;
+		default:
+			break;
+		}
 		break;
 	default:
-		DRM_ERROR("bad bpp, assuming x8r8g8b8 pixel format\n");
-		fmt = DRM_FORMAT_XRGB8888;
 		break;
 	}
 
diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c
index 781af1d42d76..636f626c5828 100644
--- a/drivers/gpu/drm/drm_framebuffer.c
+++ b/drivers/gpu/drm/drm_framebuffer.c
@@ -112,12 +112,17 @@ int drm_mode_addfb(struct drm_device *dev, struct drm_mode_fb_cmd *or,
 	struct drm_mode_fb_cmd2 r = {};
 	int ret;
 
+	r.pixel_format = drm_mode_legacy_fb_format(or->bpp, or->depth);
+	if (r.pixel_format == DRM_FORMAT_INVALID) {
+		DRM_DEBUG("bad (bpp:%d, depth:%d)\n", or->bpp, or->depth);
+		return -EINVAL;
+	}
+
 	/* convert to new format and call new ioctl */
 	r.fb_id = or->fb_id;
 	r.width = or->width;
 	r.height = or->height;
 	r.pitches[0] = or->pitch;
-	r.pixel_format = drm_mode_legacy_fb_format(or->bpp, or->depth);
 	r.handles[0] = or->handle;
 
 	if (r.pixel_format == DRM_FORMAT_XRGB2101010 &&
diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
index 2ed46e9ae16a..139632b87181 100644
--- a/include/uapi/drm/drm_fourcc.h
+++ b/include/uapi/drm/drm_fourcc.h
@@ -71,6 +71,9 @@ extern "C" {
 
 #define DRM_FORMAT_BIG_ENDIAN (1<<31) /* format is big endian instead of little endian */
 
+/* Reserve 0 for the invalid format specifier */
+#define DRM_FORMAT_INVALID	0
+
 /* color index */
 #define DRM_FORMAT_C8		fourcc_code('C', '8', ' ', ' ') /* [7:0] C */
 
-- 
2.19.0.rc1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm: Reject unknown legacy bpp and depth for drm_mode_addfb ioctl
  2018-09-05 10:22 ` [PATCH] drm: Reject unknown legacy bpp and depth " Chris Wilson
@ 2018-09-05 10:29   ` Chris Wilson
  2018-09-05 14:28   ` Daniel Vetter
  2018-09-05 15:31   ` [PATCH v3] " Chris Wilson
  2 siblings, 0 replies; 14+ messages in thread
From: Chris Wilson @ 2018-09-05 10:29 UTC (permalink / raw)
  To: dri-devel; +Cc: Daniel Vetter, intel-gfx

Quoting Chris Wilson (2018-09-05 11:22:05)
> Since this is handling user provided bpp and depth, we need to sanity
> check and propagate the EINVAL back rather than assume what the insane
> client intended and fill the logs with DRM_ERROR.
> 
> v2: Check both bpp and depth match the builtin pixel format, and
> introduce a canonical DRM_FORMAT_INVALID to reserve 0 against any future
> fourcc.
> 
> Testcase: igt/kms_addfb_basic/legacy-format
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/drm_fourcc.c      | 33 +++++++++++++++++++++----------
>  drivers/gpu/drm/drm_framebuffer.c |  7 ++++++-
>  include/uapi/drm/drm_fourcc.h     |  3 +++
>  3 files changed, 32 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c
> index 35c1e2742c27..d9dadbc43327 100644
> --- a/drivers/gpu/drm/drm_fourcc.c
> +++ b/drivers/gpu/drm/drm_fourcc.c
> @@ -45,32 +45,45 @@ static char printable_char(int c)
>   */
>  uint32_t drm_mode_legacy_fb_format(uint32_t bpp, uint32_t depth)
>  {
> -       uint32_t fmt;
> +       uint32_t fmt = DRM_FORMAT_INVALID;
>  
>         switch (bpp) {
>         case 8:
> -               fmt = DRM_FORMAT_C8;
> +               if (depth == 0)
> +                       fmt = DRM_FORMAT_C8;

Of course the downside with increasing specificity is if any userspace
was already feeding in garbage depth that just happens to work :(
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.BAT: success for drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl (rev2)
  2018-09-04 20:53 [PATCH] drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl Chris Wilson
                   ` (3 preceding siblings ...)
  2018-09-05 10:22 ` [PATCH] drm: Reject unknown legacy bpp and depth " Chris Wilson
@ 2018-09-05 11:55 ` Patchwork
  2018-09-05 14:55 ` ✓ Fi.CI.IGT: " Patchwork
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2018-09-05 11:55 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl (rev2)
URL   : https://patchwork.freedesktop.org/series/49150/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4772 -> Patchwork_10092 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/49150/revisions/2/mbox/

== Known issues ==

  Here are the changes found in Patchwork_10092 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@kms_frontbuffer_tracking@basic:
      fi-byt-clapper:     PASS -> FAIL (fdo#103167)

    
    ==== Possible fixes ====

    igt@gem_exec_suspend@basic-s4-devices:
      fi-kbl-7500u:       DMESG-WARN (fdo#107139, fdo#105128) -> PASS

    igt@kms_pipe_crc_basic@read-crc-pipe-b-frame-sequence:
      fi-ilk-650:         DMESG-WARN (fdo#106387) -> PASS

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      fi-blb-e6850:       INCOMPLETE (fdo#107718) -> PASS

    
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#105128 https://bugs.freedesktop.org/show_bug.cgi?id=105128
  fdo#106387 https://bugs.freedesktop.org/show_bug.cgi?id=106387
  fdo#107139 https://bugs.freedesktop.org/show_bug.cgi?id=107139
  fdo#107718 https://bugs.freedesktop.org/show_bug.cgi?id=107718


== Participating hosts (54 -> 49) ==

  Missing    (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-hsw-4200u 


== Build changes ==

    * Linux: CI_DRM_4772 -> Patchwork_10092

  CI_DRM_4772: 1351ee8f3aacdb8f4a71cd17a7035556065c59a9 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4629: c3b6d69aa3dd2d1a6c1f2e787670a0aef78f2ea5 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10092: a45f2f453a4c5c43baad34e27142bd73f27063dd @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

a45f2f453a4c drm: Reject unknown legacy bpp and depth for drm_mode_addfb ioctl

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10092/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm: Reject unknown legacy bpp and depth for drm_mode_addfb ioctl
  2018-09-05 10:22 ` [PATCH] drm: Reject unknown legacy bpp and depth " Chris Wilson
  2018-09-05 10:29   ` Chris Wilson
@ 2018-09-05 14:28   ` Daniel Vetter
  2018-09-05 15:31   ` [PATCH v3] " Chris Wilson
  2 siblings, 0 replies; 14+ messages in thread
From: Daniel Vetter @ 2018-09-05 14:28 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Daniel Vetter, intel-gfx, dri-devel

On Wed, Sep 05, 2018 at 11:22:05AM +0100, Chris Wilson wrote:
> Since this is handling user provided bpp and depth, we need to sanity
> check and propagate the EINVAL back rather than assume what the insane
> client intended and fill the logs with DRM_ERROR.
> 
> v2: Check both bpp and depth match the builtin pixel format, and
> introduce a canonical DRM_FORMAT_INVALID to reserve 0 against any future
> fourcc.
> 
> Testcase: igt/kms_addfb_basic/legacy-format
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>

I checked a bunch of randomly selected userspace pieces, and if there's
hairy stuff going on then it's mis-selected bpp.
> ---
>  drivers/gpu/drm/drm_fourcc.c      | 33 +++++++++++++++++++++----------
>  drivers/gpu/drm/drm_framebuffer.c |  7 ++++++-
>  include/uapi/drm/drm_fourcc.h     |  3 +++
>  3 files changed, 32 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c
> index 35c1e2742c27..d9dadbc43327 100644
> --- a/drivers/gpu/drm/drm_fourcc.c
> +++ b/drivers/gpu/drm/drm_fourcc.c
> @@ -45,32 +45,45 @@ static char printable_char(int c)
>   */
>  uint32_t drm_mode_legacy_fb_format(uint32_t bpp, uint32_t depth)
>  {
> -	uint32_t fmt;
> +	uint32_t fmt = DRM_FORMAT_INVALID;
>  
>  	switch (bpp) {
>  	case 8:
> -		fmt = DRM_FORMAT_C8;
> +		if (depth == 0)
> +			fmt = DRM_FORMAT_C8;

Michel Dänzer thinks this should be depth == 8 here. I grepped around in
-modesetting, seems outright not supported. Apparently amd drivers do
support it, and set 8/8. With that addressed:

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>


>  		break;
>  	case 16:
> -		if (depth == 15)
> +		switch (depth) {
> +		case 15:
>  			fmt = DRM_FORMAT_XRGB1555;
> -		else
> +			break;
> +		case 16:
>  			fmt = DRM_FORMAT_RGB565;
> +			break;
> +		default:
> +			break;
> +		}
>  		break;
>  	case 24:
> -		fmt = DRM_FORMAT_RGB888;
> +		if (depth == 24)
> +			fmt = DRM_FORMAT_RGB888;
>  		break;
>  	case 32:
> -		if (depth == 24)
> +		switch (depth) {
> +		case 24:
>  			fmt = DRM_FORMAT_XRGB8888;
> -		else if (depth == 30)
> +			break;
> +		case 30:
>  			fmt = DRM_FORMAT_XRGB2101010;
> -		else
> +			break;
> +		case 32:
>  			fmt = DRM_FORMAT_ARGB8888;
> +			break;
> +		default:
> +			break;
> +		}
>  		break;
>  	default:
> -		DRM_ERROR("bad bpp, assuming x8r8g8b8 pixel format\n");
> -		fmt = DRM_FORMAT_XRGB8888;
>  		break;
>  	}
>  
> diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c
> index 781af1d42d76..636f626c5828 100644
> --- a/drivers/gpu/drm/drm_framebuffer.c
> +++ b/drivers/gpu/drm/drm_framebuffer.c
> @@ -112,12 +112,17 @@ int drm_mode_addfb(struct drm_device *dev, struct drm_mode_fb_cmd *or,
>  	struct drm_mode_fb_cmd2 r = {};
>  	int ret;
>  
> +	r.pixel_format = drm_mode_legacy_fb_format(or->bpp, or->depth);
> +	if (r.pixel_format == DRM_FORMAT_INVALID) {
> +		DRM_DEBUG("bad (bpp:%d, depth:%d)\n", or->bpp, or->depth);
> +		return -EINVAL;
> +	}
> +
>  	/* convert to new format and call new ioctl */
>  	r.fb_id = or->fb_id;
>  	r.width = or->width;
>  	r.height = or->height;
>  	r.pitches[0] = or->pitch;
> -	r.pixel_format = drm_mode_legacy_fb_format(or->bpp, or->depth);
>  	r.handles[0] = or->handle;
>  
>  	if (r.pixel_format == DRM_FORMAT_XRGB2101010 &&
> diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
> index 2ed46e9ae16a..139632b87181 100644
> --- a/include/uapi/drm/drm_fourcc.h
> +++ b/include/uapi/drm/drm_fourcc.h
> @@ -71,6 +71,9 @@ extern "C" {
>  
>  #define DRM_FORMAT_BIG_ENDIAN (1<<31) /* format is big endian instead of little endian */
>  
> +/* Reserve 0 for the invalid format specifier */
> +#define DRM_FORMAT_INVALID	0
> +
>  /* color index */
>  #define DRM_FORMAT_C8		fourcc_code('C', '8', ' ', ' ') /* [7:0] C */
>  
> -- 
> 2.19.0.rc1
> 

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

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

* ✓ Fi.CI.IGT: success for drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl (rev2)
  2018-09-04 20:53 [PATCH] drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl Chris Wilson
                   ` (4 preceding siblings ...)
  2018-09-05 11:55 ` ✓ Fi.CI.BAT: success for drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl (rev2) Patchwork
@ 2018-09-05 14:55 ` Patchwork
  2018-09-05 16:28 ` ✓ Fi.CI.BAT: success for drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl (rev3) Patchwork
  2018-09-05 22:04 ` ✓ Fi.CI.IGT: " Patchwork
  7 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2018-09-05 14:55 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl (rev2)
URL   : https://patchwork.freedesktop.org/series/49150/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4772_full -> Patchwork_10092_full =

== Summary - SUCCESS ==

  No regressions found.

  

== Known issues ==

  Here are the changes found in Patchwork_10092_full that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_exec_big:
      shard-hsw:          PASS -> INCOMPLETE (fdo#103540)

    igt@kms_cursor_legacy@cursor-vs-flip-atomic-transitions-varying-size:
      shard-hsw:          PASS -> FAIL (fdo#103355)

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-indfb-plflip-blt:
      shard-glk:          PASS -> FAIL (fdo#103167)

    igt@kms_vblank@pipe-b-ts-continuation-dpms-suspend:
      shard-apl:          PASS -> INCOMPLETE (fdo#103927)

    igt@perf@polling:
      shard-hsw:          PASS -> FAIL (fdo#102252)

    
    ==== Possible fixes ====

    igt@kms_rotation_crc@primary-rotation-180:
      shard-kbl:          DMESG-WARN (fdo#105602, fdo#103558) -> PASS +9

    igt@perf_pmu@rc6-runtime-pm:
      shard-apl:          FAIL (fdo#105010) -> PASS

    
  fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103355 https://bugs.freedesktop.org/show_bug.cgi?id=103355
  fdo#103540 https://bugs.freedesktop.org/show_bug.cgi?id=103540
  fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
  fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
  fdo#105010 https://bugs.freedesktop.org/show_bug.cgi?id=105010
  fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602


== Participating hosts (5 -> 5) ==

  No changes in participating hosts


== Build changes ==

    * Linux: CI_DRM_4772 -> Patchwork_10092

  CI_DRM_4772: 1351ee8f3aacdb8f4a71cd17a7035556065c59a9 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4629: c3b6d69aa3dd2d1a6c1f2e787670a0aef78f2ea5 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10092: a45f2f453a4c5c43baad34e27142bd73f27063dd @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10092/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH v3] drm: Reject unknown legacy bpp and depth for drm_mode_addfb ioctl
  2018-09-05 10:22 ` [PATCH] drm: Reject unknown legacy bpp and depth " Chris Wilson
  2018-09-05 10:29   ` Chris Wilson
  2018-09-05 14:28   ` Daniel Vetter
@ 2018-09-05 15:31   ` Chris Wilson
  2018-09-06  7:19     ` Chris Wilson
  2 siblings, 1 reply; 14+ messages in thread
From: Chris Wilson @ 2018-09-05 15:31 UTC (permalink / raw)
  To: dri-devel; +Cc: Daniel Vetter, intel-gfx, Michel Dänzer

Since this is handling user provided bpp and depth, we need to sanity
check and propagate the EINVAL back rather than assume what the insane
client intended and fill the logs with DRM_ERROR.

v2: Check both bpp and depth match the builtin pixel format, and
introduce a canonical DRM_FORMAT_INVALID to reserve 0 against any future
fourcc.

v3: Mark up DRM_FORMAT_C8 as being {bpp:8, depth:8}

Testcase: igt/kms_addfb_basic/legacy-format
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/drm_fourcc.c      | 37 ++++++++++++++++++++++---------
 drivers/gpu/drm/drm_framebuffer.c |  7 +++++-
 include/uapi/drm/drm_fourcc.h     |  3 +++
 3 files changed, 36 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c
index 35c1e2742c27..be1d6aaef651 100644
--- a/drivers/gpu/drm/drm_fourcc.c
+++ b/drivers/gpu/drm/drm_fourcc.c
@@ -45,32 +45,49 @@ static char printable_char(int c)
  */
 uint32_t drm_mode_legacy_fb_format(uint32_t bpp, uint32_t depth)
 {
-	uint32_t fmt;
+	uint32_t fmt = DRM_FORMAT_INVALID;
 
 	switch (bpp) {
 	case 8:
-		fmt = DRM_FORMAT_C8;
+		if (depth == 8)
+			fmt = DRM_FORMAT_C8;
 		break;
+
 	case 16:
-		if (depth == 15)
+		switch (depth) {
+		case 15:
 			fmt = DRM_FORMAT_XRGB1555;
-		else
+			break;
+		case 16:
 			fmt = DRM_FORMAT_RGB565;
+			break;
+		default:
+			break;
+		}
 		break;
+
 	case 24:
-		fmt = DRM_FORMAT_RGB888;
+		if (depth == 24)
+			fmt = DRM_FORMAT_RGB888;
 		break;
+
 	case 32:
-		if (depth == 24)
+		switch (depth) {
+		case 24:
 			fmt = DRM_FORMAT_XRGB8888;
-		else if (depth == 30)
+			break;
+		case 30:
 			fmt = DRM_FORMAT_XRGB2101010;
-		else
+			break;
+		case 32:
 			fmt = DRM_FORMAT_ARGB8888;
+			break;
+		default:
+			break;
+		}
 		break;
+
 	default:
-		DRM_ERROR("bad bpp, assuming x8r8g8b8 pixel format\n");
-		fmt = DRM_FORMAT_XRGB8888;
 		break;
 	}
 
diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c
index 781af1d42d76..636f626c5828 100644
--- a/drivers/gpu/drm/drm_framebuffer.c
+++ b/drivers/gpu/drm/drm_framebuffer.c
@@ -112,12 +112,17 @@ int drm_mode_addfb(struct drm_device *dev, struct drm_mode_fb_cmd *or,
 	struct drm_mode_fb_cmd2 r = {};
 	int ret;
 
+	r.pixel_format = drm_mode_legacy_fb_format(or->bpp, or->depth);
+	if (r.pixel_format == DRM_FORMAT_INVALID) {
+		DRM_DEBUG("bad (bpp:%d, depth:%d)\n", or->bpp, or->depth);
+		return -EINVAL;
+	}
+
 	/* convert to new format and call new ioctl */
 	r.fb_id = or->fb_id;
 	r.width = or->width;
 	r.height = or->height;
 	r.pitches[0] = or->pitch;
-	r.pixel_format = drm_mode_legacy_fb_format(or->bpp, or->depth);
 	r.handles[0] = or->handle;
 
 	if (r.pixel_format == DRM_FORMAT_XRGB2101010 &&
diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
index 2ed46e9ae16a..139632b87181 100644
--- a/include/uapi/drm/drm_fourcc.h
+++ b/include/uapi/drm/drm_fourcc.h
@@ -71,6 +71,9 @@ extern "C" {
 
 #define DRM_FORMAT_BIG_ENDIAN (1<<31) /* format is big endian instead of little endian */
 
+/* Reserve 0 for the invalid format specifier */
+#define DRM_FORMAT_INVALID	0
+
 /* color index */
 #define DRM_FORMAT_C8		fourcc_code('C', '8', ' ', ' ') /* [7:0] C */
 
-- 
2.19.0.rc2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.BAT: success for drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl (rev3)
  2018-09-04 20:53 [PATCH] drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl Chris Wilson
                   ` (5 preceding siblings ...)
  2018-09-05 14:55 ` ✓ Fi.CI.IGT: " Patchwork
@ 2018-09-05 16:28 ` Patchwork
  2018-09-05 22:04 ` ✓ Fi.CI.IGT: " Patchwork
  7 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2018-09-05 16:28 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl (rev3)
URL   : https://patchwork.freedesktop.org/series/49150/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4772 -> Patchwork_10097 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/49150/revisions/3/mbox/

== Known issues ==

  Here are the changes found in Patchwork_10097 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@amdgpu/amd_basic@userptr:
      fi-kbl-8809g:       PASS -> INCOMPLETE (fdo#107402)

    igt@kms_frontbuffer_tracking@basic:
      fi-hsw-peppy:       PASS -> DMESG-WARN (fdo#102614)
      fi-byt-clapper:     PASS -> FAIL (fdo#103167)

    
    ==== Possible fixes ====

    igt@gem_exec_suspend@basic-s4-devices:
      fi-kbl-7500u:       DMESG-WARN (fdo#107139, fdo#105128) -> PASS

    igt@kms_pipe_crc_basic@read-crc-pipe-b-frame-sequence:
      fi-ilk-650:         DMESG-WARN (fdo#106387) -> PASS

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      fi-byt-clapper:     FAIL (fdo#103191, fdo#107362) -> PASS

    
  fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
  fdo#105128 https://bugs.freedesktop.org/show_bug.cgi?id=105128
  fdo#106387 https://bugs.freedesktop.org/show_bug.cgi?id=106387
  fdo#107139 https://bugs.freedesktop.org/show_bug.cgi?id=107139
  fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
  fdo#107402 https://bugs.freedesktop.org/show_bug.cgi?id=107402


== Participating hosts (54 -> 49) ==

  Missing    (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-hsw-4200u 


== Build changes ==

    * Linux: CI_DRM_4772 -> Patchwork_10097

  CI_DRM_4772: 1351ee8f3aacdb8f4a71cd17a7035556065c59a9 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4629: c3b6d69aa3dd2d1a6c1f2e787670a0aef78f2ea5 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10097: da090f41880ea903632c27536e87fbf65f5c4360 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

da090f41880e drm: Reject unknown legacy bpp and depth for drm_mode_addfb ioctl

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10097/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.IGT: success for drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl (rev3)
  2018-09-04 20:53 [PATCH] drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl Chris Wilson
                   ` (6 preceding siblings ...)
  2018-09-05 16:28 ` ✓ Fi.CI.BAT: success for drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl (rev3) Patchwork
@ 2018-09-05 22:04 ` Patchwork
  7 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2018-09-05 22:04 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl (rev3)
URL   : https://patchwork.freedesktop.org/series/49150/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4772_full -> Patchwork_10097_full =

== Summary - WARNING ==

  Minor unknown changes coming with Patchwork_10097_full need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_10097_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

== Possible new issues ==

  Here are the unknown changes that may have been introduced in Patchwork_10097_full:

  === IGT changes ===

    ==== Warnings ====

    igt@pm_rc6_residency@rc6-accuracy:
      shard-kbl:          PASS -> SKIP

    
== Known issues ==

  Here are the changes found in Patchwork_10097_full that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_suspend@shrink:
      shard-hsw:          PASS -> INCOMPLETE (fdo#103540, fdo#106886)

    igt@kms_atomic_transition@1x-modeset-transitions-nonblocking:
      shard-glk:          PASS -> FAIL (fdo#105703, fdo#107409)

    igt@kms_setmode@basic:
      shard-apl:          PASS -> FAIL (fdo#99912)

    
    ==== Possible fixes ====

    igt@kms_rotation_crc@primary-rotation-180:
      shard-kbl:          DMESG-WARN (fdo#103558, fdo#105602) -> PASS +9
      shard-apl:          DMESG-WARN (fdo#103558, fdo#105602) -> PASS +9

    igt@perf_pmu@rc6-runtime-pm:
      shard-apl:          FAIL (fdo#105010) -> PASS

    
  fdo#103540 https://bugs.freedesktop.org/show_bug.cgi?id=103540
  fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
  fdo#105010 https://bugs.freedesktop.org/show_bug.cgi?id=105010
  fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
  fdo#105703 https://bugs.freedesktop.org/show_bug.cgi?id=105703
  fdo#106886 https://bugs.freedesktop.org/show_bug.cgi?id=106886
  fdo#107409 https://bugs.freedesktop.org/show_bug.cgi?id=107409
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912


== Participating hosts (5 -> 5) ==

  No changes in participating hosts


== Build changes ==

    * Linux: CI_DRM_4772 -> Patchwork_10097

  CI_DRM_4772: 1351ee8f3aacdb8f4a71cd17a7035556065c59a9 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4629: c3b6d69aa3dd2d1a6c1f2e787670a0aef78f2ea5 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10097: da090f41880ea903632c27536e87fbf65f5c4360 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10097/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH v3] drm: Reject unknown legacy bpp and depth for drm_mode_addfb ioctl
  2018-09-05 15:31   ` [PATCH v3] " Chris Wilson
@ 2018-09-06  7:19     ` Chris Wilson
  0 siblings, 0 replies; 14+ messages in thread
From: Chris Wilson @ 2018-09-06  7:19 UTC (permalink / raw)
  To: dri-devel; +Cc: Daniel Vetter, intel-gfx, Michel Dänzer

Quoting Chris Wilson (2018-09-05 16:31:16)
> Since this is handling user provided bpp and depth, we need to sanity
> check and propagate the EINVAL back rather than assume what the insane
> client intended and fill the logs with DRM_ERROR.
> 
> v2: Check both bpp and depth match the builtin pixel format, and
> introduce a canonical DRM_FORMAT_INVALID to reserve 0 against any future
> fourcc.
> 
> v3: Mark up DRM_FORMAT_C8 as being {bpp:8, depth:8}
> 
> Testcase: igt/kms_addfb_basic/legacy-format
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Michel Dänzer <michel.daenzer@amd.com>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Pushed the sanity check. Hopefully we are all happy with
DRM_FORMAT_C8:          {bpp:8,  depth:8}
DRM_FORMAT_XRGB1555:    {bpp:16, depth:15}
DRM_FORMAT_RGB565:      {bpp:16, depth:16}
DRM_FORMAT_RGB888:      {bpp:24, depth:24}
DRM_FORMAT_XRGB8888:    {bpp:32, depth:24}
DRM_FORMAT_XRGB2101010: {bpp:32, depth:30}
DRM_FORMAT_ARGB8888:    {bpp:32, depth:32}

Thanks,
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2018-09-06  7:19 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-04 20:53 [PATCH] drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl Chris Wilson
2018-09-04 21:23 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-09-04 21:46 ` [PATCH] " Daniel Vetter
2018-09-05 10:10   ` Chris Wilson
2018-09-05  4:16 ` ✓ Fi.CI.IGT: success for " Patchwork
2018-09-05 10:22 ` [PATCH] drm: Reject unknown legacy bpp and depth " Chris Wilson
2018-09-05 10:29   ` Chris Wilson
2018-09-05 14:28   ` Daniel Vetter
2018-09-05 15:31   ` [PATCH v3] " Chris Wilson
2018-09-06  7:19     ` Chris Wilson
2018-09-05 11:55 ` ✓ Fi.CI.BAT: success for drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl (rev2) Patchwork
2018-09-05 14:55 ` ✓ Fi.CI.IGT: " Patchwork
2018-09-05 16:28 ` ✓ Fi.CI.BAT: success for drm: Reject unknown legacy bpp and dpeth for drm_mode_addfb ioctl (rev3) Patchwork
2018-09-05 22:04 ` ✓ Fi.CI.IGT: " Patchwork

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.