* [PATCH 1/2] drm/plane: Export drm_plane_check_pixel_format()
@ 2018-10-26 1:32 Dhinakaran Pandiyan
2018-10-26 1:32 ` [PATCH 2/2] drm/i915: Reuse plane format modifier checks to verify addfb() arguments Dhinakaran Pandiyan
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Dhinakaran Pandiyan @ 2018-10-26 1:32 UTC (permalink / raw)
To: intel-gfx; +Cc: Dhinakaran Pandiyan, dri-devel
i915 will make use of this to fail early during framebuffer creation.
Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: dri-devel@lists.freedesktop.org
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
---
drivers/gpu/drm/drm_plane.c | 1 +
include/drm/drm_plane.h | 11 +++++++++++
2 files changed, 12 insertions(+)
diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
index 1fa98bd12003..e834788619d1 100644
--- a/drivers/gpu/drm/drm_plane.c
+++ b/drivers/gpu/drm/drm_plane.c
@@ -589,6 +589,7 @@ int drm_plane_check_pixel_format(struct drm_plane *plane,
return 0;
}
+EXPORT_SYMBOL(drm_plane_check_pixel_format);
static int __setplane_check(struct drm_plane *plane,
struct drm_crtc *crtc,
diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h
index 0a0834bef8bd..8637b5239eb3 100644
--- a/include/drm/drm_plane.h
+++ b/include/drm/drm_plane.h
@@ -763,6 +763,17 @@ static inline struct drm_plane *drm_plane_find(struct drm_device *dev,
return mo ? obj_to_plane(mo) : NULL;
}
+/**
+ * drm_plane_check_pixel_format - check format and modifier support.
+ * @plane: plane to check support against.
+ * @format: pixel format to check support for.
+ * @modifier: format modifier to check support for.
+ *
+ * Returns 0 on success or negative error code on failure.
+ */
+int drm_plane_check_pixel_format(struct drm_plane *plane,
+ u32 format, u64 modifier);
+
/**
* drm_for_each_plane_mask - iterate over planes specified by bitmask
* @plane: the loop cursor
--
2.14.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] drm/i915: Reuse plane format modifier checks to verify addfb() arguments
2018-10-26 1:32 [PATCH 1/2] drm/plane: Export drm_plane_check_pixel_format() Dhinakaran Pandiyan
@ 2018-10-26 1:32 ` Dhinakaran Pandiyan
2018-10-26 14:45 ` Ville Syrjälä
2018-10-26 1:49 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/plane: Export drm_plane_check_pixel_format() Patchwork
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Dhinakaran Pandiyan @ 2018-10-26 1:32 UTC (permalink / raw)
To: intel-gfx; +Cc: Dhinakaran Pandiyan
Currently there is some duplication of pixel format and modifier
validation code between the fb creation and plane check paths. We can
unify them by checking if any plane supports a pixel format and modifier
combination during framebuffer creation.
Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 116 ++++++-----------------------------
1 file changed, 19 insertions(+), 97 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index fe045abb6472..1b5d936a93d0 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -14362,6 +14362,19 @@ u32 intel_fb_pitch_limit(struct drm_i915_private *dev_priv,
DRM_MODE_ROTATE_0);
}
+static bool any_plane_supports_format(struct drm_i915_private *dev_priv,
+ uint64_t fb_modifier,
+ uint32_t pixel_format)
+{
+ struct drm_plane *plane;
+
+ drm_for_each_plane(plane, &dev_priv->drm)
+ if (!drm_plane_check_pixel_format(plane, pixel_format,
+ fb_modifier))
+ return true;
+ return false;
+}
+
static int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
struct drm_i915_gem_object *obj,
struct drm_mode_fb_cmd2 *mode_cmd)
@@ -14399,40 +14412,12 @@ static int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
}
}
- /* Passed in modifier sanity checking. */
- switch (mode_cmd->modifier[0]) {
- case I915_FORMAT_MOD_Y_TILED_CCS:
- case I915_FORMAT_MOD_Yf_TILED_CCS:
- switch (mode_cmd->pixel_format) {
- case DRM_FORMAT_XBGR8888:
- case DRM_FORMAT_ABGR8888:
- case DRM_FORMAT_XRGB8888:
- case DRM_FORMAT_ARGB8888:
- break;
- default:
- DRM_DEBUG_KMS("RC supported only with RGB8888 formats\n");
- goto err;
- }
- /* fall through */
- case I915_FORMAT_MOD_Yf_TILED:
- if (mode_cmd->pixel_format == DRM_FORMAT_C8) {
- DRM_DEBUG_KMS("Indexed format does not support Yf tiling\n");
- goto err;
- }
- /* fall through */
- case I915_FORMAT_MOD_Y_TILED:
- if (INTEL_GEN(dev_priv) < 9) {
- DRM_DEBUG_KMS("Unsupported tiling 0x%llx!\n",
- mode_cmd->modifier[0]);
- goto err;
- }
- break;
- case DRM_FORMAT_MOD_LINEAR:
- case I915_FORMAT_MOD_X_TILED:
- break;
- default:
- DRM_DEBUG_KMS("Unsupported fb modifier 0x%llx!\n",
- mode_cmd->modifier[0]);
+ if (!any_plane_supports_format(dev_priv, mode_cmd->modifier[0],
+ mode_cmd->pixel_format)) {
+ DRM_DEBUG_KMS("Unsupported pixel format %s or modifier 0x%llx\n",
+ drm_get_format_name(mode_cmd->pixel_format,
+ &format_name),
+ mode_cmd->modifier[0]);
goto err;
}
@@ -14466,69 +14451,6 @@ static int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
goto err;
}
- /* Reject formats not supported by any plane early. */
- switch (mode_cmd->pixel_format) {
- case DRM_FORMAT_C8:
- case DRM_FORMAT_RGB565:
- case DRM_FORMAT_XRGB8888:
- case DRM_FORMAT_ARGB8888:
- break;
- case DRM_FORMAT_XRGB1555:
- if (INTEL_GEN(dev_priv) > 3) {
- DRM_DEBUG_KMS("unsupported pixel format: %s\n",
- drm_get_format_name(mode_cmd->pixel_format, &format_name));
- goto err;
- }
- break;
- case DRM_FORMAT_ABGR8888:
- if (!IS_VALLEYVIEW(dev_priv) && !IS_CHERRYVIEW(dev_priv) &&
- INTEL_GEN(dev_priv) < 9) {
- DRM_DEBUG_KMS("unsupported pixel format: %s\n",
- drm_get_format_name(mode_cmd->pixel_format, &format_name));
- goto err;
- }
- break;
- case DRM_FORMAT_XBGR8888:
- case DRM_FORMAT_XRGB2101010:
- case DRM_FORMAT_XBGR2101010:
- if (INTEL_GEN(dev_priv) < 4) {
- DRM_DEBUG_KMS("unsupported pixel format: %s\n",
- drm_get_format_name(mode_cmd->pixel_format, &format_name));
- goto err;
- }
- break;
- case DRM_FORMAT_ABGR2101010:
- if (!IS_VALLEYVIEW(dev_priv) && !IS_CHERRYVIEW(dev_priv)) {
- DRM_DEBUG_KMS("unsupported pixel format: %s\n",
- drm_get_format_name(mode_cmd->pixel_format, &format_name));
- goto err;
- }
- break;
- case DRM_FORMAT_YUYV:
- case DRM_FORMAT_UYVY:
- case DRM_FORMAT_YVYU:
- case DRM_FORMAT_VYUY:
- if (INTEL_GEN(dev_priv) < 5 && !IS_G4X(dev_priv)) {
- DRM_DEBUG_KMS("unsupported pixel format: %s\n",
- drm_get_format_name(mode_cmd->pixel_format, &format_name));
- goto err;
- }
- break;
- case DRM_FORMAT_NV12:
- if (INTEL_GEN(dev_priv) < 9 || IS_SKYLAKE(dev_priv) ||
- IS_BROXTON(dev_priv)) {
- DRM_DEBUG_KMS("unsupported pixel format: %s\n",
- drm_get_format_name(mode_cmd->pixel_format,
- &format_name));
- goto err;
- }
- break;
- default:
- DRM_DEBUG_KMS("unsupported pixel format: %s\n",
- drm_get_format_name(mode_cmd->pixel_format, &format_name));
- goto err;
- }
-
/* FIXME need to adjust LINOFF/TILEOFF accordingly. */
if (mode_cmd->offsets[0] != 0)
goto err;
--
2.14.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread
* ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/plane: Export drm_plane_check_pixel_format()
2018-10-26 1:32 [PATCH 1/2] drm/plane: Export drm_plane_check_pixel_format() Dhinakaran Pandiyan
2018-10-26 1:32 ` [PATCH 2/2] drm/i915: Reuse plane format modifier checks to verify addfb() arguments Dhinakaran Pandiyan
@ 2018-10-26 1:49 ` Patchwork
2018-10-26 2:11 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-26 10:49 ` ✓ Fi.CI.IGT: " Patchwork
3 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-10-26 1:49 UTC (permalink / raw)
To: Dhinakaran Pandiyan; +Cc: intel-gfx
== Series Details ==
Series: series starting with [1/2] drm/plane: Export drm_plane_check_pixel_format()
URL : https://patchwork.freedesktop.org/series/51563/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip
442fd2d0bbaf drm/plane: Export drm_plane_check_pixel_format()
bce3a00f737c drm/i915: Reuse plane format modifier checks to verify addfb() arguments
-:28: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#28: FILE: drivers/gpu/drm/i915/intel_display.c:14366:
+static bool any_plane_supports_format(struct drm_i915_private *dev_priv,
+ uint64_t fb_modifier,
-:84: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#84: FILE: drivers/gpu/drm/i915/intel_display.c:14418:
+ DRM_DEBUG_KMS("Unsupported pixel format %s or modifier 0x%llx\n",
+ drm_get_format_name(mode_cmd->pixel_format,
total: 0 errors, 0 warnings, 2 checks, 134 lines checked
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* ✓ Fi.CI.BAT: success for series starting with [1/2] drm/plane: Export drm_plane_check_pixel_format()
2018-10-26 1:32 [PATCH 1/2] drm/plane: Export drm_plane_check_pixel_format() Dhinakaran Pandiyan
2018-10-26 1:32 ` [PATCH 2/2] drm/i915: Reuse plane format modifier checks to verify addfb() arguments Dhinakaran Pandiyan
2018-10-26 1:49 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/plane: Export drm_plane_check_pixel_format() Patchwork
@ 2018-10-26 2:11 ` Patchwork
2018-10-26 10:49 ` ✓ Fi.CI.IGT: " Patchwork
3 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-10-26 2:11 UTC (permalink / raw)
To: Dhinakaran Pandiyan; +Cc: intel-gfx
== Series Details ==
Series: series starting with [1/2] drm/plane: Export drm_plane_check_pixel_format()
URL : https://patchwork.freedesktop.org/series/51563/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_5038 -> Patchwork_10593 =
== Summary - SUCCESS ==
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/51563/revisions/1/mbox/
== Known issues ==
Here are the changes found in Patchwork_10593 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@kms_cursor_legacy@basic-flip-before-cursor-legacy:
fi-glk-j4005: PASS -> DMESG-WARN (fdo#105719)
igt@kms_flip@basic-plain-flip:
fi-glk-j4005: PASS -> DMESG-WARN (fdo#106097)
igt@kms_frontbuffer_tracking@basic:
fi-byt-clapper: PASS -> FAIL (fdo#103167)
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
fi-icl-u: NOTRUN -> INCOMPLETE (fdo#107713)
igt@pm_rpm@basic-rte:
fi-glk-j4005: PASS -> DMESG-WARN (fdo#106000) +1
==== Possible fixes ====
igt@kms_frontbuffer_tracking@basic:
fi-hsw-peppy: DMESG-WARN (fdo#102614) -> PASS
igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a:
fi-byt-clapper: FAIL (fdo#107362) -> PASS
igt@kms_pipe_crc_basic@read-crc-pipe-c-frame-sequence:
fi-glk-j4005: DMESG-WARN (fdo#106000) -> 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#105719 https://bugs.freedesktop.org/show_bug.cgi?id=105719
fdo#106000 https://bugs.freedesktop.org/show_bug.cgi?id=106000
fdo#106097 https://bugs.freedesktop.org/show_bug.cgi?id=106097
fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
fdo#107713 https://bugs.freedesktop.org/show_bug.cgi?id=107713
== Participating hosts (46 -> 43) ==
Additional (1): fi-icl-u
Missing (4): fi-bsw-cyan fi-ilk-m540 fi-byt-squawks fi-gdg-551
== Build changes ==
* Linux: CI_DRM_5038 -> Patchwork_10593
CI_DRM_5038: 96ecfb04d5acfcc565068c09afd6d0d713b2ddef @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4695: 81b66cf2806d6a8e9516580fb31879677487d32b @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10593: bce3a00f737ca126daa6940159d15ffc43931ac3 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
bce3a00f737c drm/i915: Reuse plane format modifier checks to verify addfb() arguments
442fd2d0bbaf drm/plane: Export drm_plane_check_pixel_format()
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10593/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* ✓ Fi.CI.IGT: success for series starting with [1/2] drm/plane: Export drm_plane_check_pixel_format()
2018-10-26 1:32 [PATCH 1/2] drm/plane: Export drm_plane_check_pixel_format() Dhinakaran Pandiyan
` (2 preceding siblings ...)
2018-10-26 2:11 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2018-10-26 10:49 ` Patchwork
3 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-10-26 10:49 UTC (permalink / raw)
To: Dhinakaran Pandiyan; +Cc: intel-gfx
== Series Details ==
Series: series starting with [1/2] drm/plane: Export drm_plane_check_pixel_format()
URL : https://patchwork.freedesktop.org/series/51563/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_5038_full -> Patchwork_10593_full =
== Summary - SUCCESS ==
No regressions found.
== Known issues ==
Here are the changes found in Patchwork_10593_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@gem_busy@close-race:
shard-apl: PASS -> DMESG-FAIL (fdo#108561)
igt@gem_exec_schedule@pi-ringfull-bsd:
shard-skl: NOTRUN -> FAIL (fdo#103158)
igt@gem_softpin@noreloc-s3:
shard-skl: NOTRUN -> INCOMPLETE (fdo#107773, fdo#104108)
igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-b:
shard-skl: NOTRUN -> DMESG-WARN (fdo#107956) +3
igt@kms_color@pipe-a-legacy-gamma:
shard-apl: PASS -> FAIL (fdo#104782, fdo#108145) +1
igt@kms_cursor_crc@cursor-256x256-onscreen:
shard-skl: NOTRUN -> FAIL (fdo#103232)
igt@kms_cursor_crc@cursor-256x85-sliding:
shard-apl: PASS -> FAIL (fdo#103232) +1
igt@kms_cursor_crc@cursor-64x64-sliding:
shard-glk: PASS -> FAIL (fdo#103232) +2
igt@kms_fbcon_fbt@psr-suspend:
shard-skl: NOTRUN -> FAIL (fdo#107882) +1
igt@kms_flip@2x-flip-vs-modeset:
shard-hsw: PASS -> DMESG-WARN (fdo#102614)
igt@kms_flip@flip-vs-expired-vblank:
shard-skl: PASS -> FAIL (fdo#105363)
igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-blt:
shard-glk: PASS -> FAIL (fdo#103167) +1
shard-apl: PASS -> FAIL (fdo#103167)
igt@kms_frontbuffer_tracking@fbc-1p-rte:
shard-glk: PASS -> FAIL (fdo#105682, fdo#103167)
igt@kms_frontbuffer_tracking@fbcpsr-stridechange:
shard-skl: NOTRUN -> FAIL (fdo#105683)
igt@kms_plane_alpha_blend@pipe-b-alpha-basic:
shard-skl: NOTRUN -> FAIL (fdo#107815, fdo#108145) +1
igt@kms_plane_alpha_blend@pipe-c-alpha-transparant-fb:
shard-skl: NOTRUN -> FAIL (fdo#108145) +2
igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
shard-skl: NOTRUN -> FAIL (fdo#108146) +2
igt@kms_plane_multiple@atomic-pipe-a-tiling-x:
shard-apl: PASS -> FAIL (fdo#103166)
igt@kms_plane_multiple@atomic-pipe-c-tiling-y:
shard-glk: PASS -> FAIL (fdo#103166)
igt@pm_backlight@fade_with_suspend:
shard-skl: NOTRUN -> FAIL (fdo#107847)
==== Possible fixes ====
igt@gem_busy@close-race:
shard-glk: DMESG-FAIL (fdo#108561) -> PASS
igt@kms_ccs@pipe-a-crc-primary-basic:
shard-skl: FAIL (fdo#107725) -> PASS
igt@kms_ccs@pipe-b-crc-sprite-planes-basic:
shard-glk: FAIL (fdo#108145) -> PASS
igt@kms_cursor_crc@cursor-256x256-dpms:
shard-skl: FAIL (fdo#103232) -> PASS
igt@kms_cursor_crc@cursor-64x21-onscreen:
shard-glk: FAIL (fdo#103232) -> PASS +2
igt@kms_cursor_crc@cursor-64x64-suspend:
shard-skl: INCOMPLETE (fdo#104108) -> PASS
igt@kms_cursor_legacy@2x-long-nonblocking-modeset-vs-cursor-atomic:
shard-glk: FAIL (fdo#105454, fdo#106509) -> PASS
igt@kms_draw_crc@fill-fb:
shard-skl: FAIL (fdo#103184) -> PASS
igt@kms_frontbuffer_tracking@fbc-2p-rte:
shard-glk: FAIL (fdo#105682, fdo#103167) -> PASS
igt@kms_plane_alpha_blend@pipe-a-coverage-7efc:
shard-skl: FAIL (fdo#107815, fdo#108145) -> PASS
igt@kms_plane_multiple@atomic-pipe-c-tiling-yf:
shard-apl: FAIL (fdo#103166) -> PASS +1
igt@perf@polling:
shard-hsw: FAIL (fdo#102252) -> PASS
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#103158 https://bugs.freedesktop.org/show_bug.cgi?id=103158
fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103184 https://bugs.freedesktop.org/show_bug.cgi?id=103184
fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232
fdo#104108 https://bugs.freedesktop.org/show_bug.cgi?id=104108
fdo#104782 https://bugs.freedesktop.org/show_bug.cgi?id=104782
fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
fdo#105454 https://bugs.freedesktop.org/show_bug.cgi?id=105454
fdo#105682 https://bugs.freedesktop.org/show_bug.cgi?id=105682
fdo#105683 https://bugs.freedesktop.org/show_bug.cgi?id=105683
fdo#106509 https://bugs.freedesktop.org/show_bug.cgi?id=106509
fdo#107725 https://bugs.freedesktop.org/show_bug.cgi?id=107725
fdo#107773 https://bugs.freedesktop.org/show_bug.cgi?id=107773
fdo#107815 https://bugs.freedesktop.org/show_bug.cgi?id=107815
fdo#107847 https://bugs.freedesktop.org/show_bug.cgi?id=107847
fdo#107882 https://bugs.freedesktop.org/show_bug.cgi?id=107882
fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956
fdo#108145 https://bugs.freedesktop.org/show_bug.cgi?id=108145
fdo#108146 https://bugs.freedesktop.org/show_bug.cgi?id=108146
fdo#108561 https://bugs.freedesktop.org/show_bug.cgi?id=108561
== Participating hosts (6 -> 6) ==
No changes in participating hosts
== Build changes ==
* Linux: CI_DRM_5038 -> Patchwork_10593
CI_DRM_5038: 96ecfb04d5acfcc565068c09afd6d0d713b2ddef @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4695: 81b66cf2806d6a8e9516580fb31879677487d32b @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10593: bce3a00f737ca126daa6940159d15ffc43931ac3 @ 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_10593/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] drm/i915: Reuse plane format modifier checks to verify addfb() arguments
2018-10-26 1:32 ` [PATCH 2/2] drm/i915: Reuse plane format modifier checks to verify addfb() arguments Dhinakaran Pandiyan
@ 2018-10-26 14:45 ` Ville Syrjälä
2018-10-26 18:39 ` Pandiyan, Dhinakaran
0 siblings, 1 reply; 7+ messages in thread
From: Ville Syrjälä @ 2018-10-26 14:45 UTC (permalink / raw)
To: Dhinakaran Pandiyan; +Cc: intel-gfx
On Thu, Oct 25, 2018 at 06:32:56PM -0700, Dhinakaran Pandiyan wrote:
> Currently there is some duplication of pixel format and modifier
> validation code between the fb creation and plane check paths. We can
> unify them by checking if any plane supports a pixel format and modifier
> combination during framebuffer creation.
>
> Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> ---
> drivers/gpu/drm/i915/intel_display.c | 116 ++++++-----------------------------
> 1 file changed, 19 insertions(+), 97 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index fe045abb6472..1b5d936a93d0 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -14362,6 +14362,19 @@ u32 intel_fb_pitch_limit(struct drm_i915_private *dev_priv,
> DRM_MODE_ROTATE_0);
> }
>
> +static bool any_plane_supports_format(struct drm_i915_private *dev_priv,
> + uint64_t fb_modifier,
> + uint32_t pixel_format)
"format first, modifier second" is the typical covention.
But I think we could stuff this entire thing into the core, in case
someone else wants to reuse it. I think I even posted the patches
that do it like that.
Ah yes: https://patchwork.freedesktop.org/series/39700/
> +{
> + struct drm_plane *plane;
> +
> + drm_for_each_plane(plane, &dev_priv->drm)
> + if (!drm_plane_check_pixel_format(plane, pixel_format,
> + fb_modifier))
> + return true;
> + return false;
> +}
> +
> static int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
> struct drm_i915_gem_object *obj,
> struct drm_mode_fb_cmd2 *mode_cmd)
> @@ -14399,40 +14412,12 @@ static int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
> }
> }
>
> - /* Passed in modifier sanity checking. */
> - switch (mode_cmd->modifier[0]) {
> - case I915_FORMAT_MOD_Y_TILED_CCS:
> - case I915_FORMAT_MOD_Yf_TILED_CCS:
> - switch (mode_cmd->pixel_format) {
> - case DRM_FORMAT_XBGR8888:
> - case DRM_FORMAT_ABGR8888:
> - case DRM_FORMAT_XRGB8888:
> - case DRM_FORMAT_ARGB8888:
> - break;
> - default:
> - DRM_DEBUG_KMS("RC supported only with RGB8888 formats\n");
> - goto err;
> - }
> - /* fall through */
> - case I915_FORMAT_MOD_Yf_TILED:
> - if (mode_cmd->pixel_format == DRM_FORMAT_C8) {
> - DRM_DEBUG_KMS("Indexed format does not support Yf tiling\n");
> - goto err;
> - }
> - /* fall through */
> - case I915_FORMAT_MOD_Y_TILED:
> - if (INTEL_GEN(dev_priv) < 9) {
> - DRM_DEBUG_KMS("Unsupported tiling 0x%llx!\n",
> - mode_cmd->modifier[0]);
> - goto err;
> - }
> - break;
> - case DRM_FORMAT_MOD_LINEAR:
> - case I915_FORMAT_MOD_X_TILED:
> - break;
> - default:
> - DRM_DEBUG_KMS("Unsupported fb modifier 0x%llx!\n",
> - mode_cmd->modifier[0]);
> + if (!any_plane_supports_format(dev_priv, mode_cmd->modifier[0],
> + mode_cmd->pixel_format)) {
> + DRM_DEBUG_KMS("Unsupported pixel format %s or modifier 0x%llx\n",
> + drm_get_format_name(mode_cmd->pixel_format,
> + &format_name),
> + mode_cmd->modifier[0]);
> goto err;
> }
>
> @@ -14466,69 +14451,6 @@ static int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
> goto err;
> }
>
> - /* Reject formats not supported by any plane early. */
> - switch (mode_cmd->pixel_format) {
> - case DRM_FORMAT_C8:
> - case DRM_FORMAT_RGB565:
> - case DRM_FORMAT_XRGB8888:
> - case DRM_FORMAT_ARGB8888:
> - break;
> - case DRM_FORMAT_XRGB1555:
> - if (INTEL_GEN(dev_priv) > 3) {
> - DRM_DEBUG_KMS("unsupported pixel format: %s\n",
> - drm_get_format_name(mode_cmd->pixel_format, &format_name));
> - goto err;
> - }
> - break;
> - case DRM_FORMAT_ABGR8888:
> - if (!IS_VALLEYVIEW(dev_priv) && !IS_CHERRYVIEW(dev_priv) &&
> - INTEL_GEN(dev_priv) < 9) {
> - DRM_DEBUG_KMS("unsupported pixel format: %s\n",
> - drm_get_format_name(mode_cmd->pixel_format, &format_name));
> - goto err;
> - }
> - break;
> - case DRM_FORMAT_XBGR8888:
> - case DRM_FORMAT_XRGB2101010:
> - case DRM_FORMAT_XBGR2101010:
> - if (INTEL_GEN(dev_priv) < 4) {
> - DRM_DEBUG_KMS("unsupported pixel format: %s\n",
> - drm_get_format_name(mode_cmd->pixel_format, &format_name));
> - goto err;
> - }
> - break;
> - case DRM_FORMAT_ABGR2101010:
> - if (!IS_VALLEYVIEW(dev_priv) && !IS_CHERRYVIEW(dev_priv)) {
> - DRM_DEBUG_KMS("unsupported pixel format: %s\n",
> - drm_get_format_name(mode_cmd->pixel_format, &format_name));
> - goto err;
> - }
> - break;
> - case DRM_FORMAT_YUYV:
> - case DRM_FORMAT_UYVY:
> - case DRM_FORMAT_YVYU:
> - case DRM_FORMAT_VYUY:
> - if (INTEL_GEN(dev_priv) < 5 && !IS_G4X(dev_priv)) {
> - DRM_DEBUG_KMS("unsupported pixel format: %s\n",
> - drm_get_format_name(mode_cmd->pixel_format, &format_name));
> - goto err;
> - }
> - break;
> - case DRM_FORMAT_NV12:
> - if (INTEL_GEN(dev_priv) < 9 || IS_SKYLAKE(dev_priv) ||
> - IS_BROXTON(dev_priv)) {
> - DRM_DEBUG_KMS("unsupported pixel format: %s\n",
> - drm_get_format_name(mode_cmd->pixel_format,
> - &format_name));
> - goto err;
> - }
> - break;
> - default:
> - DRM_DEBUG_KMS("unsupported pixel format: %s\n",
> - drm_get_format_name(mode_cmd->pixel_format, &format_name));
> - goto err;
> - }
> -
> /* FIXME need to adjust LINOFF/TILEOFF accordingly. */
> if (mode_cmd->offsets[0] != 0)
> goto err;
> --
> 2.14.1
--
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] drm/i915: Reuse plane format modifier checks to verify addfb() arguments
2018-10-26 14:45 ` Ville Syrjälä
@ 2018-10-26 18:39 ` Pandiyan, Dhinakaran
0 siblings, 0 replies; 7+ messages in thread
From: Pandiyan, Dhinakaran @ 2018-10-26 18:39 UTC (permalink / raw)
To: Ville Syrjälä; +Cc: intel-gfx
> -----Original Message-----
> From: Ville Syrjälä [mailto:ville.syrjala@linux.intel.com]
> Sent: Friday, October 26, 2018 7:46 AM
> To: Pandiyan, Dhinakaran <dhinakaran.pandiyan@intel.com>
> Cc: intel-gfx@lists.freedesktop.org
> Subject: Re: [PATCH 2/2] drm/i915: Reuse plane format modifier checks to
> verify addfb() arguments
>
> On Thu, Oct 25, 2018 at 06:32:56PM -0700, Dhinakaran Pandiyan wrote:
> > Currently there is some duplication of pixel format and modifier
> > validation code between the fb creation and plane check paths. We can
> > unify them by checking if any plane supports a pixel format and
> > modifier combination during framebuffer creation.
> >
> > Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> > ---
> > drivers/gpu/drm/i915/intel_display.c | 116
> > ++++++-----------------------------
> > 1 file changed, 19 insertions(+), 97 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c
> > b/drivers/gpu/drm/i915/intel_display.c
> > index fe045abb6472..1b5d936a93d0 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -14362,6 +14362,19 @@ u32 intel_fb_pitch_limit(struct
> drm_i915_private *dev_priv,
> > DRM_MODE_ROTATE_0);
> > }
> >
> > +static bool any_plane_supports_format(struct drm_i915_private
> *dev_priv,
> > + uint64_t fb_modifier,
> > + uint32_t pixel_format)
>
> "format first, modifier second" is the typical covention.
Yeah, I did go that way. intel_fb_pitch_limit() that's right above inverts the order,
so I switched it keep it locally consistent.
>
> But I think we could stuff this entire thing into the core, in case someone else
> wants to reuse it. I think I even posted the patches that do it like that.
> Ah yes: https://patchwork.freedesktop.org/series/39700/
Since you posted them first, let's go with it. Patches 1-3 look good to me, can
you rebase and send them to the list? The second patch does not apply.
>
> > +{
> > + struct drm_plane *plane;
> > +
> > + drm_for_each_plane(plane, &dev_priv->drm)
> > + if (!drm_plane_check_pixel_format(plane, pixel_format,
> > + fb_modifier))
> > + return true;
> > + return false;
> > +}
> > +
> > static int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
> > struct drm_i915_gem_object *obj,
> > struct drm_mode_fb_cmd2 *mode_cmd)
> @@ -14399,40 +14412,12 @@
> > static int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
> > }
> > }
> >
> > - /* Passed in modifier sanity checking. */
> > - switch (mode_cmd->modifier[0]) {
> > - case I915_FORMAT_MOD_Y_TILED_CCS:
> > - case I915_FORMAT_MOD_Yf_TILED_CCS:
> > - switch (mode_cmd->pixel_format) {
> > - case DRM_FORMAT_XBGR8888:
> > - case DRM_FORMAT_ABGR8888:
> > - case DRM_FORMAT_XRGB8888:
> > - case DRM_FORMAT_ARGB8888:
> > - break;
> > - default:
> > - DRM_DEBUG_KMS("RC supported only with
> RGB8888 formats\n");
> > - goto err;
> > - }
> > - /* fall through */
> > - case I915_FORMAT_MOD_Yf_TILED:
> > - if (mode_cmd->pixel_format == DRM_FORMAT_C8) {
> > - DRM_DEBUG_KMS("Indexed format does not
> support Yf tiling\n");
> > - goto err;
> > - }
> > - /* fall through */
> > - case I915_FORMAT_MOD_Y_TILED:
> > - if (INTEL_GEN(dev_priv) < 9) {
> > - DRM_DEBUG_KMS("Unsupported tiling 0x%llx!\n",
> > - mode_cmd->modifier[0]);
> > - goto err;
> > - }
> > - break;
> > - case DRM_FORMAT_MOD_LINEAR:
> > - case I915_FORMAT_MOD_X_TILED:
> > - break;
> > - default:
> > - DRM_DEBUG_KMS("Unsupported fb modifier 0x%llx!\n",
> > - mode_cmd->modifier[0]);
> > + if (!any_plane_supports_format(dev_priv, mode_cmd->modifier[0],
> > + mode_cmd->pixel_format)) {
> > + DRM_DEBUG_KMS("Unsupported pixel format %s or
> modifier 0x%llx\n",
> > + drm_get_format_name(mode_cmd-
> >pixel_format,
> > + &format_name),
> > + mode_cmd->modifier[0]);
> > goto err;
> > }
> >
> > @@ -14466,69 +14451,6 @@ static int intel_framebuffer_init(struct
> intel_framebuffer *intel_fb,
> > goto err;
> > }
> >
> > - /* Reject formats not supported by any plane early. */
> > - switch (mode_cmd->pixel_format) {
> > - case DRM_FORMAT_C8:
> > - case DRM_FORMAT_RGB565:
> > - case DRM_FORMAT_XRGB8888:
> > - case DRM_FORMAT_ARGB8888:
> > - break;
> > - case DRM_FORMAT_XRGB1555:
> > - if (INTEL_GEN(dev_priv) > 3) {
> > - DRM_DEBUG_KMS("unsupported pixel format:
> %s\n",
> > - drm_get_format_name(mode_cmd-
> >pixel_format, &format_name));
> > - goto err;
> > - }
> > - break;
> > - case DRM_FORMAT_ABGR8888:
> > - if (!IS_VALLEYVIEW(dev_priv) && !IS_CHERRYVIEW(dev_priv)
> &&
> > - INTEL_GEN(dev_priv) < 9) {
> > - DRM_DEBUG_KMS("unsupported pixel format:
> %s\n",
> > - drm_get_format_name(mode_cmd-
> >pixel_format, &format_name));
> > - goto err;
> > - }
> > - break;
> > - case DRM_FORMAT_XBGR8888:
> > - case DRM_FORMAT_XRGB2101010:
> > - case DRM_FORMAT_XBGR2101010:
> > - if (INTEL_GEN(dev_priv) < 4) {
> > - DRM_DEBUG_KMS("unsupported pixel format:
> %s\n",
> > - drm_get_format_name(mode_cmd-
> >pixel_format, &format_name));
> > - goto err;
> > - }
> > - break;
> > - case DRM_FORMAT_ABGR2101010:
> > - if (!IS_VALLEYVIEW(dev_priv) &&
> !IS_CHERRYVIEW(dev_priv)) {
> > - DRM_DEBUG_KMS("unsupported pixel format:
> %s\n",
> > - drm_get_format_name(mode_cmd-
> >pixel_format, &format_name));
> > - goto err;
> > - }
> > - break;
> > - case DRM_FORMAT_YUYV:
> > - case DRM_FORMAT_UYVY:
> > - case DRM_FORMAT_YVYU:
> > - case DRM_FORMAT_VYUY:
> > - if (INTEL_GEN(dev_priv) < 5 && !IS_G4X(dev_priv)) {
> > - DRM_DEBUG_KMS("unsupported pixel format:
> %s\n",
> > - drm_get_format_name(mode_cmd-
> >pixel_format, &format_name));
> > - goto err;
> > - }
> > - break;
> > - case DRM_FORMAT_NV12:
> > - if (INTEL_GEN(dev_priv) < 9 || IS_SKYLAKE(dev_priv) ||
> > - IS_BROXTON(dev_priv)) {
> > - DRM_DEBUG_KMS("unsupported pixel format:
> %s\n",
> > - drm_get_format_name(mode_cmd-
> >pixel_format,
> > - &format_name));
> > - goto err;
> > - }
> > - break;
> > - default:
> > - DRM_DEBUG_KMS("unsupported pixel format: %s\n",
> > - drm_get_format_name(mode_cmd-
> >pixel_format, &format_name));
> > - goto err;
> > - }
> > -
> > /* FIXME need to adjust LINOFF/TILEOFF accordingly. */
> > if (mode_cmd->offsets[0] != 0)
> > goto err;
> > --
> > 2.14.1
>
> --
> Ville Syrjälä
> Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-10-26 18:39 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-26 1:32 [PATCH 1/2] drm/plane: Export drm_plane_check_pixel_format() Dhinakaran Pandiyan
2018-10-26 1:32 ` [PATCH 2/2] drm/i915: Reuse plane format modifier checks to verify addfb() arguments Dhinakaran Pandiyan
2018-10-26 14:45 ` Ville Syrjälä
2018-10-26 18:39 ` Pandiyan, Dhinakaran
2018-10-26 1:49 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/plane: Export drm_plane_check_pixel_format() Patchwork
2018-10-26 2:11 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-26 10:49 ` ✓ 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.