* [PATCH v4 1/2] drm: Add color management LUT validation helper (v4)
@ 2018-12-17 22:44 Matt Roper
2018-12-17 22:44 ` [PATCH v4 2/2] drm/i915: Validate userspace-provided color management LUT's (v3) Matt Roper
` (6 more replies)
0 siblings, 7 replies; 13+ messages in thread
From: Matt Roper @ 2018-12-17 22:44 UTC (permalink / raw)
To: dri-devel, intel-gfx; +Cc: Swati Sharma, Uma Shankar
Some hardware may place additional restrictions on the gamma/degamma
curves described by our LUT properties. E.g., that a gamma curve never
decreases or that the red/green/blue channels of a LUT's entries must be
equal. Let's add a helper function that drivers can use to test that a
userspace-provided LUT is valid and doesn't violate hardware
requirements.
v2:
- Combine into a single helper that just takes a bitmask of the tests
to apply. (Brian Starkey)
- Add additional check (always performed) that LUT property blob size
is always a multiple of the LUT entry size. (stolen from ARM driver)
v3:
- Drop the LUT size check again since
drm_atomic_replace_property_blob_from_id() already covers this for
us. (Alexandru Gheorghe)
v4:
- Use an enum to describe possible test values rather than #define's;
this is cleaner to provide kerneldoc for. (Daniel Vetter)
- s/DRM_COLOR_LUT_INCREASING/DRM_COLOR_LUT_NON_DECREASING/. (Ville)
Cc: Uma Shankar <uma.shankar@intel.com>
Cc: Swati Sharma <swati2.sharma@intel.com>
Cc: Brian Starkey <Brian.Starkey@arm.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by(v1): Brian Starkey <brian.starkey@arm.com>
Reviewed-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
---
drivers/gpu/drm/drm_color_mgmt.c | 44 ++++++++++++++++++++++++++++++++++++++++
include/drm/drm_color_mgmt.h | 29 ++++++++++++++++++++++++++
2 files changed, 73 insertions(+)
diff --git a/drivers/gpu/drm/drm_color_mgmt.c b/drivers/gpu/drm/drm_color_mgmt.c
index 07dcf47daafe..968ca7c91ad8 100644
--- a/drivers/gpu/drm/drm_color_mgmt.c
+++ b/drivers/gpu/drm/drm_color_mgmt.c
@@ -462,3 +462,47 @@ int drm_plane_create_color_properties(struct drm_plane *plane,
return 0;
}
EXPORT_SYMBOL(drm_plane_create_color_properties);
+
+/**
+ * drm_color_lut_check - check validity of lookup table
+ * @lut: property blob containing LUT to check
+ * @tests: bitmask of tests to run
+ *
+ * Helper to check whether a userspace-provided lookup table is valid and
+ * satisfies hardware requirements. Drivers pass a bitmask indicating which of
+ * the tests in &drm_color_lut_tests should be performed.
+ *
+ * Returns 0 on success, -EINVAL on failure.
+ */
+int drm_color_lut_check(struct drm_property_blob *lut,
+ uint32_t tests)
+{
+ struct drm_color_lut *entry;
+ int i;
+
+ if (!lut || !tests)
+ return 0;
+
+ entry = lut->data;
+ for (i = 0; i < drm_color_lut_size(lut); i++) {
+ if (tests & DRM_COLOR_LUT_EQUAL_CHANNELS) {
+ if (entry[i].red != entry[i].blue ||
+ entry[i].red != entry[i].green) {
+ DRM_DEBUG_KMS("All LUT entries must have equal r/g/b\n");
+ return -EINVAL;
+ }
+ }
+
+ if (i > 0 && tests & DRM_COLOR_LUT_NON_DECREASING) {
+ if (entry[i].red < entry[i - 1].red ||
+ entry[i].green < entry[i - 1].green ||
+ entry[i].blue < entry[i - 1].blue) {
+ DRM_DEBUG_KMS("LUT entries must never decrease.\n");
+ return -EINVAL;
+ }
+ }
+ }
+
+ return 0;
+}
+EXPORT_SYMBOL(drm_color_lut_check);
diff --git a/include/drm/drm_color_mgmt.h b/include/drm/drm_color_mgmt.h
index 90ef9996d9a4..6affbda6d9cb 100644
--- a/include/drm/drm_color_mgmt.h
+++ b/include/drm/drm_color_mgmt.h
@@ -69,4 +69,33 @@ int drm_plane_create_color_properties(struct drm_plane *plane,
u32 supported_ranges,
enum drm_color_encoding default_encoding,
enum drm_color_range default_range);
+
+/**
+ * enum drm_color_lut_tests - hw-specific LUT tests to perform
+ *
+ * The drm_color_lut_check() function takes a bitmask of the values here to
+ * determine which tests to apply to a userspace-provided LUT.
+ */
+enum drm_color_lut_tests {
+ /**
+ * @DRM_COLOR_LUT_EQUAL_CHANNELS:
+ *
+ * Checks whether the entries of a LUT all have equal values for the
+ * red, green, and blue channels. Intended for hardware that only
+ * accepts a single value per LUT entry and assumes that value applies
+ * to all three color components.
+ */
+ DRM_COLOR_LUT_EQUAL_CHANNELS = BIT(0),
+
+ /**
+ * @DRM_COLOR_LUT_NON_DECREASING:
+ *
+ * Checks whether the entries of a LUT are always flat or increasing
+ * (never decreasing).
+ */
+ DRM_COLOR_LUT_NON_DECREASING = BIT(1),
+};
+
+int drm_color_lut_check(struct drm_property_blob *lut,
+ uint32_t tests);
#endif
--
2.14.4
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v4 2/2] drm/i915: Validate userspace-provided color management LUT's (v3)
2018-12-17 22:44 [PATCH v4 1/2] drm: Add color management LUT validation helper (v4) Matt Roper
@ 2018-12-17 22:44 ` Matt Roper
2018-12-18 14:04 ` Ville Syrjälä
2018-12-17 23:16 ` ✓ Fi.CI.BAT: success for series starting with [v4,1/2] drm: Add color management LUT validation helper (v4) Patchwork
` (5 subsequent siblings)
6 siblings, 1 reply; 13+ messages in thread
From: Matt Roper @ 2018-12-17 22:44 UTC (permalink / raw)
To: dri-devel, intel-gfx
We currently program userspace-provided gamma and degamma LUT's into our
hardware without really checking to see whether they satisfy our
hardware's rules. We should try to catch tables that are invalid for
our hardware early and reject the atomic transaction.
All of our platforms that accept a degamma LUT expect that the entries
in the LUT are always flat or increasing, never decreasing. Also, our
GLK and ICL platforms only accept degamma tables with r=g=b entries; so
we should also add the relevant checks for that in anticipation of
degamma support landing for those platforms.
v2:
- Use new API (single check function with bitmask of tests to apply)
- Call helper for our gamma table as well (with no additional tests
specified) so that the table size will be validated.
v3:
- Don't call on the gamma table since the LUT size is already tested at
property blob upload and we don't have any additional hardware
constraints for that LUT.
Cc: Uma Shankar <uma.shankar@intel.com>
Cc: Swati Sharma <swati2.sharma@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
---
drivers/gpu/drm/i915/intel_color.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_color.c b/drivers/gpu/drm/i915/intel_color.c
index 37fd9ddf762e..bdbe474ad9b2 100644
--- a/drivers/gpu/drm/i915/intel_color.c
+++ b/drivers/gpu/drm/i915/intel_color.c
@@ -609,10 +609,26 @@ int intel_color_check(struct intel_crtc_state *crtc_state)
{
struct drm_i915_private *dev_priv = to_i915(crtc_state->base.crtc->dev);
size_t gamma_length, degamma_length;
+ uint32_t tests = DRM_COLOR_LUT_NON_DECREASING;
degamma_length = INTEL_INFO(dev_priv)->color.degamma_lut_size;
gamma_length = INTEL_INFO(dev_priv)->color.gamma_lut_size;
+ /*
+ * All of our platforms mandate that the degamma curve be
+ * non-decreasing. Additionally, GLK and gen11 only accept a single
+ * value for red, green, and blue in the degamma table. Make sure
+ * userspace didn't try to pass us something we can't handle.
+ *
+ * We don't have any extra hardware constraints on the gamma table,
+ * so no need to explicitly check it.
+ */
+ if (IS_GEMINILAKE(dev_priv) || INTEL_GEN(dev_priv) >= 11)
+ tests |= DRM_COLOR_LUT_EQUAL_CHANNELS;
+
+ if (drm_color_lut_check(crtc_state->base.degamma_lut, tests) != 0)
+ return -EINVAL;
+
/*
* We allow both degamma & gamma luts at the right size or
* NULL.
--
2.14.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 13+ messages in thread
* ✓ Fi.CI.BAT: success for series starting with [v4,1/2] drm: Add color management LUT validation helper (v4)
2018-12-17 22:44 [PATCH v4 1/2] drm: Add color management LUT validation helper (v4) Matt Roper
2018-12-17 22:44 ` [PATCH v4 2/2] drm/i915: Validate userspace-provided color management LUT's (v3) Matt Roper
@ 2018-12-17 23:16 ` Patchwork
2018-12-18 1:55 ` ✓ Fi.CI.IGT: " Patchwork
` (4 subsequent siblings)
6 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2018-12-17 23:16 UTC (permalink / raw)
To: Matt Roper; +Cc: intel-gfx
== Series Details ==
Series: series starting with [v4,1/2] drm: Add color management LUT validation helper (v4)
URL : https://patchwork.freedesktop.org/series/54170/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_5325 -> Patchwork_11111
====================================================
Summary
-------
**WARNING**
Minor unknown changes coming with Patchwork_11111 need to be verified
manually.
If you think the reported changes have nothing to do with the changes
introduced in Patchwork_11111, please notify your bug team to allow them
to document this new failure mode, which will reduce false positives in CI.
External URL: https://patchwork.freedesktop.org/api/1.0/series/54170/revisions/1/mbox/
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_11111:
### IGT changes ###
#### Warnings ####
* igt@kms_pipe_crc_basic@nonblocking-crc-pipe-c:
- fi-kbl-7567u: PASS -> SKIP +33
Known issues
------------
Here are the changes found in Patchwork_11111 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_ctx_create@basic-files:
- fi-bsw-kefka: PASS -> FAIL [fdo#108656]
* igt@i915_selftest@live_hangcheck:
- fi-kbl-7560u: PASS -> INCOMPLETE [fdo#108044]
* igt@kms_flip@basic-flip-vs-wf_vblank:
- fi-pnv-d510: PASS -> FAIL [fdo#100368]
* igt@kms_pipe_crc_basic@read-crc-pipe-b:
- fi-byt-clapper: PASS -> FAIL [fdo#107362]
#### Possible fixes ####
* igt@gem_mmap_gtt@basic-small-copy-xy:
- fi-glk-dsi: INCOMPLETE [fdo#103359] / [k.org#198133] -> PASS
* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: FAIL [fdo#108767] -> PASS
* igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b:
- fi-byt-clapper: FAIL [fdo#107362] -> PASS
[fdo#100368]: https://bugs.freedesktop.org/show_bug.cgi?id=100368
[fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
[fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
[fdo#108044]: https://bugs.freedesktop.org/show_bug.cgi?id=108044
[fdo#108656]: https://bugs.freedesktop.org/show_bug.cgi?id=108656
[fdo#108767]: https://bugs.freedesktop.org/show_bug.cgi?id=108767
[k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133
Participating hosts (49 -> 46)
------------------------------
Additional (1): fi-cfl-8109u
Missing (4): fi-kbl-soraka fi-ilk-m540 fi-byt-squawks fi-bsw-cyan
Build changes
-------------
* Linux: CI_DRM_5325 -> Patchwork_11111
CI_DRM_5325: d1085cddae920b9a0c326e3cc3e342cfee14aed2 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4749: 270da20849db4d170db09673c6b67712c90ec9fe @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_11111: 166f53049b7de6967309928e0beeba7cd53fa93b @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
166f53049b7d drm/i915: Validate userspace-provided color management LUT's (v3)
4c5837ff3174 drm: Add color management LUT validation helper (v4)
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_11111/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 13+ messages in thread
* ✓ Fi.CI.IGT: success for series starting with [v4,1/2] drm: Add color management LUT validation helper (v4)
2018-12-17 22:44 [PATCH v4 1/2] drm: Add color management LUT validation helper (v4) Matt Roper
2018-12-17 22:44 ` [PATCH v4 2/2] drm/i915: Validate userspace-provided color management LUT's (v3) Matt Roper
2018-12-17 23:16 ` ✓ Fi.CI.BAT: success for series starting with [v4,1/2] drm: Add color management LUT validation helper (v4) Patchwork
@ 2018-12-18 1:55 ` Patchwork
2018-12-18 18:30 ` ✓ Fi.CI.BAT: success for series starting with [v4,1/2] drm: Add color management LUT validation helper (v4) (rev2) Patchwork
` (3 subsequent siblings)
6 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2018-12-18 1:55 UTC (permalink / raw)
To: Matt Roper; +Cc: intel-gfx
== Series Details ==
Series: series starting with [v4,1/2] drm: Add color management LUT validation helper (v4)
URL : https://patchwork.freedesktop.org/series/54170/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_5325_full -> Patchwork_11111_full
====================================================
Summary
-------
**WARNING**
Minor unknown changes coming with Patchwork_11111_full need to be verified
manually.
If you think the reported changes have nothing to do with the changes
introduced in Patchwork_11111_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_11111_full:
### IGT changes ###
#### Warnings ####
* igt@perf_pmu@rc6:
- shard-kbl: PASS -> SKIP
* igt@pm_rc6_residency@rc6-accuracy:
- shard-snb: SKIP -> PASS
Known issues
------------
Here are the changes found in Patchwork_11111_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_schedule@pi-ringfull-blt:
- shard-skl: NOTRUN -> FAIL [fdo#103158] +1
* igt@gem_exec_schedule@pi-ringfull-vebox:
- shard-iclb: NOTRUN -> FAIL [fdo#103158]
* igt@gem_userptr_blits@readonly-unsync:
- shard-skl: NOTRUN -> TIMEOUT [fdo#108887]
* igt@kms_atomic@plane_primary_legacy:
- shard-iclb: PASS -> DMESG-WARN [fdo#107724] +8
* igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-b:
- shard-skl: NOTRUN -> DMESG-WARN [fdo#107956] +2
* igt@kms_cursor_crc@cursor-128x128-dpms:
- shard-glk: PASS -> FAIL [fdo#103232]
* igt@kms_cursor_crc@cursor-128x42-onscreen:
- shard-iclb: NOTRUN -> FAIL [fdo#103232] +1
* igt@kms_cursor_crc@cursor-64x21-random:
- shard-apl: PASS -> FAIL [fdo#103232] +3
* igt@kms_cursor_crc@cursor-64x64-suspend:
- shard-skl: PASS -> INCOMPLETE [fdo#104108]
- shard-apl: PASS -> FAIL [fdo#103191] / [fdo#103232]
* igt@kms_fbcon_fbt@fbc-suspend:
- shard-skl: PASS -> INCOMPLETE [fdo#104108] / [fdo#107773]
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-blt:
- shard-iclb: NOTRUN -> FAIL [fdo#103167]
* igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-onoff:
- shard-glk: PASS -> FAIL [fdo#103167] +2
* igt@kms_frontbuffer_tracking@fbc-suspend:
- shard-skl: PASS -> INCOMPLETE [fdo#104108] / [fdo#105959] / [fdo#107773]
* igt@kms_frontbuffer_tracking@psr-1p-primscrn-spr-indfb-fullscreen:
- shard-iclb: PASS -> FAIL [fdo#103167] +4
* igt@kms_plane@pixel-format-pipe-a-planes-source-clamping:
- shard-skl: NOTRUN -> DMESG-WARN [fdo#106885]
* igt@kms_plane@pixel-format-pipe-c-planes:
- shard-glk: PASS -> FAIL [fdo#103166] +1
* igt@kms_plane@plane-position-covered-pipe-b-planes:
- shard-iclb: PASS -> FAIL [fdo#103166] +1
* igt@kms_plane_alpha_blend@pipe-b-alpha-opaque-fb:
- shard-apl: PASS -> FAIL [fdo#108145]
* igt@kms_plane_multiple@atomic-pipe-a-tiling-x:
- shard-apl: PASS -> FAIL [fdo#103166] +2
* igt@kms_sysfs_edid_timing:
- shard-skl: NOTRUN -> FAIL [fdo#100047]
* igt@kms_vblank@pipe-a-ts-continuation-dpms-suspend:
- shard-kbl: PASS -> INCOMPLETE [fdo#103665]
* igt@pm_rpm@fences:
- shard-iclb: PASS -> INCOMPLETE [fdo#108840]
* igt@pm_rpm@modeset-lpsp:
- shard-skl: PASS -> INCOMPLETE [fdo#107807]
* igt@pm_rpm@universal-planes:
- shard-iclb: PASS -> DMESG-WARN [fdo#108654]
* igt@pm_rps@min-max-config-loaded:
- shard-iclb: NOTRUN -> FAIL [fdo#102250]
#### Possible fixes ####
* igt@drm_read@empty-block:
- shard-iclb: DMESG-WARN [fdo#107724] -> PASS +3
* igt@gem_eio@in-flight-contexts-immediate:
- shard-glk: FAIL [fdo#107799] -> PASS
* igt@gem_workarounds@suspend-resume-fd:
- shard-iclb: INCOMPLETE [fdo#107713] -> PASS +1
* igt@kms_available_modes_crc@available_mode_test_crc:
- shard-apl: FAIL [fdo#106641] -> PASS
* igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-b:
- shard-kbl: DMESG-WARN [fdo#107956] -> PASS
* igt@kms_color@pipe-b-degamma:
- shard-apl: FAIL [fdo#104782] -> PASS
* igt@kms_cursor_crc@cursor-256x256-onscreen:
- shard-skl: FAIL [fdo#103232] -> PASS
* igt@kms_cursor_crc@cursor-256x256-random:
- shard-glk: FAIL [fdo#103232] -> PASS +2
- shard-apl: FAIL [fdo#103232] -> PASS +1
* igt@kms_cursor_crc@cursor-256x256-suspend:
- shard-apl: FAIL [fdo#103191] / [fdo#103232] -> PASS
* igt@kms_flip@flip-vs-expired-vblank:
- shard-skl: FAIL [fdo#105363] -> PASS
* igt@kms_flip@modeset-vs-vblank-race-interruptible:
- shard-apl: FAIL [fdo#103060] -> PASS
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-shrfb-draw-blt:
- shard-iclb: DMESG-FAIL [fdo#107724] -> PASS
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-gtt:
- shard-apl: FAIL [fdo#103167] -> PASS +2
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
- shard-iclb: FAIL [fdo#103167] -> PASS +9
- shard-glk: FAIL [fdo#103167] -> PASS +2
* igt@kms_frontbuffer_tracking@fbcpsr-rgb101010-draw-mmap-gtt:
- shard-iclb: DMESG-WARN [fdo#107724] / [fdo#108336] -> PASS +2
* igt@kms_pipe_crc_basic@hang-read-crc-pipe-c:
- shard-skl: FAIL [fdo#103191] / [fdo#107362] -> PASS
* igt@kms_plane@pixel-format-pipe-a-planes-source-clamping:
- shard-apl: FAIL [fdo#108948] -> PASS
* igt@kms_plane_alpha_blend@pipe-a-coverage-7efc:
- shard-skl: FAIL [fdo#107815] / [fdo#108145] -> PASS
* igt@kms_plane_alpha_blend@pipe-b-constant-alpha-max:
- shard-glk: FAIL [fdo#108145] -> PASS +1
* igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
- shard-skl: FAIL [fdo#107815] -> PASS
* igt@kms_plane_multiple@atomic-pipe-b-tiling-x:
- shard-apl: FAIL [fdo#103166] -> PASS +1
* igt@kms_plane_multiple@atomic-pipe-c-tiling-yf:
- shard-iclb: FAIL [fdo#103166] -> PASS +2
* igt@kms_rotation_crc@multiplane-rotation-cropping-top:
- shard-glk: DMESG-WARN [fdo#105763] / [fdo#106538] -> PASS
* igt@kms_setmode@basic:
- shard-hsw: FAIL [fdo#99912] -> PASS
* igt@pm_rpm@debugfs-read:
- shard-iclb: DMESG-WARN [fdo#108654] -> PASS
* igt@pm_rpm@gem-execbuf-stress-extra-wait:
- shard-skl: INCOMPLETE [fdo#107803] / [fdo#107807] -> PASS
* igt@pm_rpm@modeset-non-lpsp-stress-no-wait:
- shard-iclb: INCOMPLETE [fdo#108840] -> SKIP
#### Warnings ####
* igt@kms_rotation_crc@multiplane-rotation-cropping-top:
- shard-kbl: DMESG-WARN [fdo#105604] -> DMESG-FAIL [fdo#108950]
[fdo#100047]: https://bugs.freedesktop.org/show_bug.cgi?id=100047
[fdo#102250]: https://bugs.freedesktop.org/show_bug.cgi?id=102250
[fdo#103060]: https://bugs.freedesktop.org/show_bug.cgi?id=103060
[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#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[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#105604]: https://bugs.freedesktop.org/show_bug.cgi?id=105604
[fdo#105763]: https://bugs.freedesktop.org/show_bug.cgi?id=105763
[fdo#105959]: https://bugs.freedesktop.org/show_bug.cgi?id=105959
[fdo#106538]: https://bugs.freedesktop.org/show_bug.cgi?id=106538
[fdo#106641]: https://bugs.freedesktop.org/show_bug.cgi?id=106641
[fdo#106885]: https://bugs.freedesktop.org/show_bug.cgi?id=106885
[fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#107773]: https://bugs.freedesktop.org/show_bug.cgi?id=107773
[fdo#107799]: https://bugs.freedesktop.org/show_bug.cgi?id=107799
[fdo#107803]: https://bugs.freedesktop.org/show_bug.cgi?id=107803
[fdo#107807]: https://bugs.freedesktop.org/show_bug.cgi?id=107807
[fdo#107815]: https://bugs.freedesktop.org/show_bug.cgi?id=107815
[fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108336]: https://bugs.freedesktop.org/show_bug.cgi?id=108336
[fdo#108654]: https://bugs.freedesktop.org/show_bug.cgi?id=108654
[fdo#108840]: https://bugs.freedesktop.org/show_bug.cgi?id=108840
[fdo#108887]: https://bugs.freedesktop.org/show_bug.cgi?id=108887
[fdo#108948]: https://bugs.freedesktop.org/show_bug.cgi?id=108948
[fdo#108950]: https://bugs.freedesktop.org/show_bug.cgi?id=108950
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
Participating hosts (7 -> 7)
------------------------------
No changes in participating hosts
Build changes
-------------
* Linux: CI_DRM_5325 -> Patchwork_11111
CI_DRM_5325: d1085cddae920b9a0c326e3cc3e342cfee14aed2 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4749: 270da20849db4d170db09673c6b67712c90ec9fe @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_11111: 166f53049b7de6967309928e0beeba7cd53fa93b @ 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_11111/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v4 2/2] drm/i915: Validate userspace-provided color management LUT's (v3)
2018-12-17 22:44 ` [PATCH v4 2/2] drm/i915: Validate userspace-provided color management LUT's (v3) Matt Roper
@ 2018-12-18 14:04 ` Ville Syrjälä
2018-12-18 17:51 ` [PATCH v4 2/2] drm/i915: Validate userspace-provided color management LUT's (v4) Matt Roper
0 siblings, 1 reply; 13+ messages in thread
From: Ville Syrjälä @ 2018-12-18 14:04 UTC (permalink / raw)
To: Matt Roper; +Cc: intel-gfx, dri-devel
On Mon, Dec 17, 2018 at 02:44:15PM -0800, Matt Roper wrote:
> We currently program userspace-provided gamma and degamma LUT's into our
> hardware without really checking to see whether they satisfy our
> hardware's rules. We should try to catch tables that are invalid for
> our hardware early and reject the atomic transaction.
>
> All of our platforms that accept a degamma LUT expect that the entries
> in the LUT are always flat or increasing, never decreasing. Also, our
> GLK and ICL platforms only accept degamma tables with r=g=b entries; so
> we should also add the relevant checks for that in anticipation of
> degamma support landing for those platforms.
>
> v2:
> - Use new API (single check function with bitmask of tests to apply)
> - Call helper for our gamma table as well (with no additional tests
> specified) so that the table size will be validated.
>
> v3:
> - Don't call on the gamma table since the LUT size is already tested at
> property blob upload and we don't have any additional hardware
> constraints for that LUT.
>
> Cc: Uma Shankar <uma.shankar@intel.com>
> Cc: Swati Sharma <swati2.sharma@intel.com>
> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
> Reviewed-by: Uma Shankar <uma.shankar@intel.com>
> ---
> drivers/gpu/drm/i915/intel_color.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_color.c b/drivers/gpu/drm/i915/intel_color.c
> index 37fd9ddf762e..bdbe474ad9b2 100644
> --- a/drivers/gpu/drm/i915/intel_color.c
> +++ b/drivers/gpu/drm/i915/intel_color.c
> @@ -609,10 +609,26 @@ int intel_color_check(struct intel_crtc_state *crtc_state)
> {
> struct drm_i915_private *dev_priv = to_i915(crtc_state->base.crtc->dev);
> size_t gamma_length, degamma_length;
> + uint32_t tests = DRM_COLOR_LUT_NON_DECREASING;
>
> degamma_length = INTEL_INFO(dev_priv)->color.degamma_lut_size;
> gamma_length = INTEL_INFO(dev_priv)->color.gamma_lut_size;
>
> + /*
> + * All of our platforms mandate that the degamma curve be
> + * non-decreasing. Additionally, GLK and gen11 only accept a single
> + * value for red, green, and blue in the degamma table. Make sure
> + * userspace didn't try to pass us something we can't handle.
> + *
> + * We don't have any extra hardware constraints on the gamma table,
> + * so no need to explicitly check it.
> + */
> + if (IS_GEMINILAKE(dev_priv) || INTEL_GEN(dev_priv) >= 11)
> + tests |= DRM_COLOR_LUT_EQUAL_CHANNELS;
>= 10 ?
> +
> + if (drm_color_lut_check(crtc_state->base.degamma_lut, tests) != 0)
> + return -EINVAL;
> +
> /*
> * We allow both degamma & gamma luts at the right size or
> * NULL.
> --
> 2.14.4
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
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] 13+ messages in thread
* [PATCH v4 2/2] drm/i915: Validate userspace-provided color management LUT's (v4)
2018-12-18 14:04 ` Ville Syrjälä
@ 2018-12-18 17:51 ` Matt Roper
2019-01-25 20:00 ` Ville Syrjälä
0 siblings, 1 reply; 13+ messages in thread
From: Matt Roper @ 2018-12-18 17:51 UTC (permalink / raw)
To: intel-gfx
We currently program userspace-provided gamma and degamma LUT's into our
hardware without really checking to see whether they satisfy our
hardware's rules. We should try to catch tables that are invalid for
our hardware early and reject the atomic transaction.
All of our platforms that accept a degamma LUT expect that the entries
in the LUT are always flat or increasing, never decreasing. Also, our
GLK and ICL platforms only accept degamma tables with r=g=b entries; so
we should also add the relevant checks for that in anticipation of
degamma support landing for those platforms.
v2:
- Use new API (single check function with bitmask of tests to apply)
- Call helper for our gamma table as well (with no additional tests
specified) so that the table size will be validated.
v3:
- Don't call on the gamma table since the LUT size is already tested at
property blob upload and we don't have any additional hardware
constraints for that LUT.
v4:
- Apply equal color channel check on gen10 as well; the bspec has some
strange tagging for CNL platforms, but this appears to apply there as
well. (Ville)
Cc: Uma Shankar <uma.shankar@intel.com>
Cc: Swati Sharma <swati2.sharma@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
---
drivers/gpu/drm/i915/intel_color.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_color.c b/drivers/gpu/drm/i915/intel_color.c
index 37fd9ddf762e..e3ffbb0ad9a6 100644
--- a/drivers/gpu/drm/i915/intel_color.c
+++ b/drivers/gpu/drm/i915/intel_color.c
@@ -609,10 +609,26 @@ int intel_color_check(struct intel_crtc_state *crtc_state)
{
struct drm_i915_private *dev_priv = to_i915(crtc_state->base.crtc->dev);
size_t gamma_length, degamma_length;
+ uint32_t tests = DRM_COLOR_LUT_NON_DECREASING;
degamma_length = INTEL_INFO(dev_priv)->color.degamma_lut_size;
gamma_length = INTEL_INFO(dev_priv)->color.gamma_lut_size;
+ /*
+ * All of our platforms mandate that the degamma curve be
+ * non-decreasing. Additionally, GLK and gen11 only accept a single
+ * value for red, green, and blue in the degamma table. Make sure
+ * userspace didn't try to pass us something we can't handle.
+ *
+ * We don't have any extra hardware constraints on the gamma table,
+ * so no need to explicitly check it.
+ */
+ if (IS_GEMINILAKE(dev_priv) || INTEL_GEN(dev_priv) >= 10)
+ tests |= DRM_COLOR_LUT_EQUAL_CHANNELS;
+
+ if (drm_color_lut_check(crtc_state->base.degamma_lut, tests) != 0)
+ return -EINVAL;
+
/*
* We allow both degamma & gamma luts at the right size or
* NULL.
--
2.14.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 13+ messages in thread
* ✓ Fi.CI.BAT: success for series starting with [v4,1/2] drm: Add color management LUT validation helper (v4) (rev2)
2018-12-17 22:44 [PATCH v4 1/2] drm: Add color management LUT validation helper (v4) Matt Roper
` (2 preceding siblings ...)
2018-12-18 1:55 ` ✓ Fi.CI.IGT: " Patchwork
@ 2018-12-18 18:30 ` Patchwork
2018-12-19 1:27 ` ✗ Fi.CI.IGT: failure " Patchwork
` (2 subsequent siblings)
6 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2018-12-18 18:30 UTC (permalink / raw)
To: Matt Roper; +Cc: intel-gfx
== Series Details ==
Series: series starting with [v4,1/2] drm: Add color management LUT validation helper (v4) (rev2)
URL : https://patchwork.freedesktop.org/series/54170/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_5331 -> Patchwork_11117
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/54170/revisions/2/mbox/
Known issues
------------
Here are the changes found in Patchwork_11117 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_selftest@live_contexts:
- fi-kbl-7560u: PASS -> INCOMPLETE [fdo#108767]
* igt@kms_busy@basic-flip-b:
- fi-gdg-551: PASS -> FAIL [fdo#103182]
* {igt@runner@aborted}:
- fi-icl-y: NOTRUN -> FAIL [fdo#108070]
#### Possible fixes ####
* igt@i915_module_load@reload-with-fault-injection:
- fi-byt-clapper: WARN [fdo#108688] -> PASS
* igt@i915_selftest@live_hangcheck:
- fi-skl-guc: DMESG-FAIL [fdo#108593] -> PASS
* igt@kms_flip@basic-flip-vs-dpms:
- fi-skl-6700hq: DMESG-WARN [fdo#105998] -> PASS
* igt@kms_pipe_crc_basic@hang-read-crc-pipe-a:
- fi-byt-clapper: FAIL [fdo#103191] / [fdo#107362] -> PASS
* igt@pm_rpm@module-reload:
- fi-byt-clapper: FAIL [fdo#108675] -> PASS
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#105998]: https://bugs.freedesktop.org/show_bug.cgi?id=105998
[fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
[fdo#108070]: https://bugs.freedesktop.org/show_bug.cgi?id=108070
[fdo#108593]: https://bugs.freedesktop.org/show_bug.cgi?id=108593
[fdo#108675]: https://bugs.freedesktop.org/show_bug.cgi?id=108675
[fdo#108688]: https://bugs.freedesktop.org/show_bug.cgi?id=108688
[fdo#108767]: https://bugs.freedesktop.org/show_bug.cgi?id=108767
Participating hosts (50 -> 43)
------------------------------
Additional (1): fi-icl-y
Missing (8): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-glk-dsi fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-glk-j4005
Build changes
-------------
* Linux: CI_DRM_5331 -> Patchwork_11117
CI_DRM_5331: 9373de80d37b523811cea7cfbf4de7b996096bcd @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4749: 270da20849db4d170db09673c6b67712c90ec9fe @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_11117: b1f633593bbd31aac725ce3d091aee6a94a77398 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
b1f633593bbd drm/i915: Validate userspace-provided color management LUT's (v4)
5f5162d9a56b drm: Add color management LUT validation helper (v4)
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_11117/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 13+ messages in thread
* ✗ Fi.CI.IGT: failure for series starting with [v4,1/2] drm: Add color management LUT validation helper (v4) (rev2)
2018-12-17 22:44 [PATCH v4 1/2] drm: Add color management LUT validation helper (v4) Matt Roper
` (3 preceding siblings ...)
2018-12-18 18:30 ` ✓ Fi.CI.BAT: success for series starting with [v4,1/2] drm: Add color management LUT validation helper (v4) (rev2) Patchwork
@ 2018-12-19 1:27 ` Patchwork
2018-12-19 10:43 ` ✓ Fi.CI.IGT: success " Patchwork
2019-01-11 22:27 ` [PATCH v4 1/2] drm: Add color management LUT validation helper (v4) Matt Roper
6 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2018-12-19 1:27 UTC (permalink / raw)
To: Matt Roper; +Cc: intel-gfx
== Series Details ==
Series: series starting with [v4,1/2] drm: Add color management LUT validation helper (v4) (rev2)
URL : https://patchwork.freedesktop.org/series/54170/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_5331_full -> Patchwork_11117_full
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_11117_full absolutely need to be
verified manually.
If you think the reported changes have nothing to do with the changes
introduced in Patchwork_11117_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_11117_full:
### IGT changes ###
#### Possible regressions ####
* igt@debugfs_test@read_all_entries_display_on:
- shard-iclb: PASS -> INCOMPLETE
#### Warnings ####
* igt@perf_pmu@rc6:
- shard-kbl: PASS -> SKIP
Known issues
------------
Here are the changes found in Patchwork_11117_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_schedule@pi-ringfull-render:
- shard-skl: NOTRUN -> FAIL [fdo#103158]
* igt@gem_userptr_blits@readonly-unsync:
- shard-skl: NOTRUN -> TIMEOUT [fdo#108887]
* igt@i915_missed_irq:
- shard-apl: PASS -> INCOMPLETE [fdo#103927]
* igt@kms_busy@extended-modeset-hang-newfb-render-a:
- shard-iclb: NOTRUN -> DMESG-WARN [fdo#107956]
* igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-c:
- shard-skl: NOTRUN -> DMESG-WARN [fdo#107956] +1
* igt@kms_busy@extended-modeset-hang-oldfb-with-reset-render-a:
- shard-iclb: PASS -> DMESG-WARN [fdo#107724] +12
* igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-a:
- shard-glk: NOTRUN -> DMESG-WARN [fdo#107956]
* igt@kms_ccs@pipe-a-crc-sprite-planes-basic:
- shard-iclb: NOTRUN -> FAIL [fdo#107725]
* igt@kms_cursor_crc@cursor-256x256-onscreen:
- shard-skl: PASS -> FAIL [fdo#103232]
- shard-glk: PASS -> FAIL [fdo#103232] +1
* igt@kms_cursor_crc@cursor-64x21-random:
- shard-apl: PASS -> FAIL [fdo#103232] +2
* igt@kms_cursor_crc@cursor-64x64-sliding:
- shard-iclb: NOTRUN -> FAIL [fdo#103232] +2
* igt@kms_cursor_crc@cursor-64x64-suspend:
- shard-skl: NOTRUN -> INCOMPLETE [fdo#104108]
- shard-apl: PASS -> FAIL [fdo#103191] / [fdo#103232]
* igt@kms_draw_crc@draw-method-rgb565-render-untiled:
- shard-iclb: PASS -> WARN [fdo#108336] +2
* igt@kms_flip@2x-flip-vs-expired-vblank:
- shard-glk: PASS -> FAIL [fdo#105363]
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-mmap-gtt:
- shard-apl: PASS -> FAIL [fdo#103167]
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-wc:
- shard-iclb: NOTRUN -> FAIL [fdo#103167]
* igt@kms_frontbuffer_tracking@fbc-rgb565-draw-pwrite:
- shard-iclb: PASS -> DMESG-FAIL [fdo#107724] +3
* igt@kms_frontbuffer_tracking@psr-1p-primscrn-pri-shrfb-draw-mmap-gtt:
- shard-iclb: PASS -> DMESG-WARN [fdo#107724] / [fdo#108336] +7
* igt@kms_frontbuffer_tracking@psr-1p-primscrn-spr-indfb-draw-blt:
- shard-iclb: PASS -> FAIL [fdo#103167] +2
* igt@kms_pipe_crc_basic@hang-read-crc-pipe-c:
- shard-skl: PASS -> FAIL [fdo#103191] / [fdo#107362]
* igt@kms_plane@plane-position-covered-pipe-c-planes:
- shard-apl: PASS -> FAIL [fdo#103166] +1
* igt@kms_plane_alpha_blend@pipe-b-constant-alpha-max:
- shard-glk: PASS -> FAIL [fdo#108145] +2
* igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
- shard-skl: PASS -> FAIL [fdo#107815] +1
* igt@kms_plane_multiple@atomic-pipe-b-tiling-yf:
- shard-iclb: PASS -> FAIL [fdo#103166] +2
- shard-glk: PASS -> FAIL [fdo#103166]
* igt@kms_sysfs_edid_timing:
- shard-iclb: PASS -> FAIL [fdo#100047]
- shard-skl: NOTRUN -> FAIL [fdo#100047]
* igt@sw_sync@sync_busy_fork:
- shard-kbl: PASS -> INCOMPLETE [fdo#103665] +1
#### Possible fixes ####
* igt@gem_workarounds@suspend-resume-context:
- shard-iclb: INCOMPLETE [fdo#107713] -> PASS
* igt@kms_color@pipe-b-ctm-max:
- shard-apl: FAIL [fdo#108147] -> PASS
* igt@kms_cursor_crc@cursor-128x128-dpms:
- shard-glk: FAIL [fdo#103232] -> PASS
* igt@kms_cursor_crc@cursor-256x256-random:
- shard-apl: FAIL [fdo#103232] -> PASS +1
* igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size:
- shard-skl: FAIL [fdo#102670] / [fdo#106081] -> PASS
* igt@kms_draw_crc@draw-method-rgb565-mmap-gtt-untiled:
- shard-iclb: WARN [fdo#108336] -> PASS
* igt@kms_flip@modeset-vs-vblank-race-interruptible:
- shard-glk: FAIL [fdo#103060] -> PASS
* igt@kms_flip_tiling@flip-to-yf-tiled:
- shard-iclb: DMESG-WARN [fdo#107724] / [fdo#108336] -> PASS +2
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-gtt:
- shard-apl: FAIL [fdo#103167] -> PASS +1
* igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-draw-mmap-wc:
- shard-glk: FAIL [fdo#103167] -> PASS +3
* igt@kms_plane@pixel-format-pipe-a-planes-source-clamping:
- shard-glk: FAIL [fdo#108948] -> PASS
- shard-apl: FAIL [fdo#108948] -> PASS
* igt@kms_plane@pixel-format-pipe-c-planes:
- shard-glk: FAIL [fdo#103166] -> PASS
* igt@kms_plane_alpha_blend@pipe-a-coverage-7efc:
- shard-skl: FAIL [fdo#107815] / [fdo#108145] -> PASS
* igt@kms_plane_multiple@atomic-pipe-a-tiling-y:
- shard-apl: FAIL [fdo#103166] -> PASS
* igt@kms_rotation_crc@multiplane-rotation-cropping-top:
- shard-kbl: DMESG-WARN [fdo#105604] -> PASS
* igt@kms_setmode@basic:
- shard-apl: FAIL [fdo#99912] -> PASS
- shard-kbl: FAIL [fdo#99912] -> PASS
* igt@pm_rpm@gem-evict-pwrite:
- shard-iclb: DMESG-WARN [fdo#107724] -> PASS +7
* igt@pm_rpm@legacy-planes:
- shard-iclb: DMESG-WARN [fdo#108654] -> PASS
* igt@pm_rpm@modeset-non-lpsp-stress-no-wait:
- shard-iclb: INCOMPLETE [fdo#108840] -> SKIP
* igt@pm_rpm@modeset-pc8-residency-stress:
- shard-skl: INCOMPLETE [fdo#107807] -> SKIP
#### Warnings ####
* igt@gem_ppgtt@blt-vs-render-ctx0:
- shard-skl: TIMEOUT [fdo#108039] -> INCOMPLETE [fdo#106887]
* igt@i915_suspend@shrink:
- shard-skl: DMESG-WARN [fdo#108784] -> INCOMPLETE [fdo#106886]
* igt@kms_cursor_crc@cursor-256x85-sliding:
- shard-iclb: FAIL [fdo#103232] -> DMESG-WARN [fdo#107724] / [fdo#108336]
* igt@kms_plane@plane-position-covered-pipe-b-planes:
- shard-iclb: FAIL [fdo#103166] -> DMESG-WARN [fdo#107724] / [fdo#108336] +1
[fdo#100047]: https://bugs.freedesktop.org/show_bug.cgi?id=100047
[fdo#102670]: https://bugs.freedesktop.org/show_bug.cgi?id=102670
[fdo#103060]: https://bugs.freedesktop.org/show_bug.cgi?id=103060
[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#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#105604]: https://bugs.freedesktop.org/show_bug.cgi?id=105604
[fdo#106081]: https://bugs.freedesktop.org/show_bug.cgi?id=106081
[fdo#106886]: https://bugs.freedesktop.org/show_bug.cgi?id=106886
[fdo#106887]: https://bugs.freedesktop.org/show_bug.cgi?id=106887
[fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#107725]: https://bugs.freedesktop.org/show_bug.cgi?id=107725
[fdo#107807]: https://bugs.freedesktop.org/show_bug.cgi?id=107807
[fdo#107815]: https://bugs.freedesktop.org/show_bug.cgi?id=107815
[fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
[fdo#108039]: https://bugs.freedesktop.org/show_bug.cgi?id=108039
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108147]: https://bugs.freedesktop.org/show_bug.cgi?id=108147
[fdo#108336]: https://bugs.freedesktop.org/show_bug.cgi?id=108336
[fdo#108654]: https://bugs.freedesktop.org/show_bug.cgi?id=108654
[fdo#108784]: https://bugs.freedesktop.org/show_bug.cgi?id=108784
[fdo#108840]: https://bugs.freedesktop.org/show_bug.cgi?id=108840
[fdo#108887]: https://bugs.freedesktop.org/show_bug.cgi?id=108887
[fdo#108948]: https://bugs.freedesktop.org/show_bug.cgi?id=108948
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
Participating hosts (7 -> 7)
------------------------------
No changes in participating hosts
Build changes
-------------
* Linux: CI_DRM_5331 -> Patchwork_11117
CI_DRM_5331: 9373de80d37b523811cea7cfbf4de7b996096bcd @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4749: 270da20849db4d170db09673c6b67712c90ec9fe @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_11117: b1f633593bbd31aac725ce3d091aee6a94a77398 @ 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_11117/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 13+ messages in thread
* ✓ Fi.CI.IGT: success for series starting with [v4,1/2] drm: Add color management LUT validation helper (v4) (rev2)
2018-12-17 22:44 [PATCH v4 1/2] drm: Add color management LUT validation helper (v4) Matt Roper
` (4 preceding siblings ...)
2018-12-19 1:27 ` ✗ Fi.CI.IGT: failure " Patchwork
@ 2018-12-19 10:43 ` Patchwork
2019-01-11 22:27 ` [PATCH v4 1/2] drm: Add color management LUT validation helper (v4) Matt Roper
6 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2018-12-19 10:43 UTC (permalink / raw)
To: Matt Roper; +Cc: intel-gfx
== Series Details ==
Series: series starting with [v4,1/2] drm: Add color management LUT validation helper (v4) (rev2)
URL : https://patchwork.freedesktop.org/series/54170/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_5331_full -> Patchwork_11117_full
====================================================
Summary
-------
**WARNING**
Minor unknown changes coming with Patchwork_11117_full need to be verified
manually.
If you think the reported changes have nothing to do with the changes
introduced in Patchwork_11117_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_11117_full:
### IGT changes ###
#### Warnings ####
* igt@perf_pmu@rc6:
- shard-kbl: PASS -> SKIP
Known issues
------------
Here are the changes found in Patchwork_11117_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@debugfs_test@read_all_entries_display_on:
- shard-iclb: PASS -> INCOMPLETE [fdo#109097]
* igt@gem_exec_schedule@pi-ringfull-render:
- shard-skl: NOTRUN -> FAIL [fdo#103158]
* igt@gem_userptr_blits@readonly-unsync:
- shard-skl: NOTRUN -> TIMEOUT [fdo#108887]
* igt@i915_missed_irq:
- shard-apl: PASS -> INCOMPLETE [fdo#103927]
* igt@kms_busy@extended-modeset-hang-newfb-render-a:
- shard-iclb: NOTRUN -> DMESG-WARN [fdo#107956]
* igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-c:
- shard-skl: NOTRUN -> DMESG-WARN [fdo#107956] +1
* igt@kms_busy@extended-modeset-hang-oldfb-with-reset-render-a:
- shard-iclb: PASS -> DMESG-WARN [fdo#107724] +12
* igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-a:
- shard-glk: NOTRUN -> DMESG-WARN [fdo#107956]
* igt@kms_ccs@pipe-a-crc-sprite-planes-basic:
- shard-iclb: NOTRUN -> FAIL [fdo#107725]
* igt@kms_cursor_crc@cursor-256x256-onscreen:
- shard-skl: PASS -> FAIL [fdo#103232]
- shard-glk: PASS -> FAIL [fdo#103232] +1
* igt@kms_cursor_crc@cursor-64x21-random:
- shard-apl: PASS -> FAIL [fdo#103232] +2
* igt@kms_cursor_crc@cursor-64x64-sliding:
- shard-iclb: NOTRUN -> FAIL [fdo#103232] +2
* igt@kms_cursor_crc@cursor-64x64-suspend:
- shard-skl: NOTRUN -> INCOMPLETE [fdo#104108]
- shard-apl: PASS -> FAIL [fdo#103191] / [fdo#103232]
* igt@kms_draw_crc@draw-method-rgb565-render-untiled:
- shard-iclb: PASS -> WARN [fdo#108336] +2
* igt@kms_flip@2x-flip-vs-expired-vblank:
- shard-glk: PASS -> FAIL [fdo#105363]
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-mmap-gtt:
- shard-apl: PASS -> FAIL [fdo#103167]
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-wc:
- shard-iclb: NOTRUN -> FAIL [fdo#103167]
* igt@kms_frontbuffer_tracking@fbc-rgb565-draw-pwrite:
- shard-iclb: PASS -> DMESG-FAIL [fdo#107724] +3
* igt@kms_frontbuffer_tracking@psr-1p-primscrn-pri-shrfb-draw-mmap-gtt:
- shard-iclb: PASS -> DMESG-WARN [fdo#107724] / [fdo#108336] +7
* igt@kms_frontbuffer_tracking@psr-1p-primscrn-spr-indfb-draw-blt:
- shard-iclb: PASS -> FAIL [fdo#103167] +2
* igt@kms_pipe_crc_basic@hang-read-crc-pipe-c:
- shard-skl: PASS -> FAIL [fdo#103191] / [fdo#107362]
* igt@kms_plane@plane-position-covered-pipe-c-planes:
- shard-apl: PASS -> FAIL [fdo#103166] +1
* igt@kms_plane_alpha_blend@pipe-b-constant-alpha-max:
- shard-glk: PASS -> FAIL [fdo#108145] +2
* igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
- shard-skl: PASS -> FAIL [fdo#107815] +1
* igt@kms_plane_multiple@atomic-pipe-b-tiling-yf:
- shard-iclb: PASS -> FAIL [fdo#103166] +2
- shard-glk: PASS -> FAIL [fdo#103166]
* igt@kms_sysfs_edid_timing:
- shard-iclb: PASS -> FAIL [fdo#100047]
- shard-skl: NOTRUN -> FAIL [fdo#100047]
* igt@sw_sync@sync_busy_fork:
- shard-kbl: PASS -> INCOMPLETE [fdo#103665] +1
#### Possible fixes ####
* igt@gem_workarounds@suspend-resume-context:
- shard-iclb: INCOMPLETE [fdo#107713] -> PASS
* igt@kms_color@pipe-b-ctm-max:
- shard-apl: FAIL [fdo#108147] -> PASS
* igt@kms_cursor_crc@cursor-128x128-dpms:
- shard-glk: FAIL [fdo#103232] -> PASS
* igt@kms_cursor_crc@cursor-256x256-random:
- shard-apl: FAIL [fdo#103232] -> PASS +1
* igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size:
- shard-skl: FAIL [fdo#102670] / [fdo#106081] -> PASS
* igt@kms_draw_crc@draw-method-rgb565-mmap-gtt-untiled:
- shard-iclb: WARN [fdo#108336] -> PASS
* igt@kms_flip@modeset-vs-vblank-race-interruptible:
- shard-glk: FAIL [fdo#103060] -> PASS
* igt@kms_flip_tiling@flip-to-yf-tiled:
- shard-iclb: DMESG-WARN [fdo#107724] / [fdo#108336] -> PASS +2
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-gtt:
- shard-apl: FAIL [fdo#103167] -> PASS +1
* igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-draw-mmap-wc:
- shard-glk: FAIL [fdo#103167] -> PASS +3
* igt@kms_plane@pixel-format-pipe-a-planes-source-clamping:
- shard-glk: FAIL [fdo#108948] -> PASS
- shard-apl: FAIL [fdo#108948] -> PASS
* igt@kms_plane@pixel-format-pipe-c-planes:
- shard-glk: FAIL [fdo#103166] -> PASS
* igt@kms_plane_alpha_blend@pipe-a-coverage-7efc:
- shard-skl: FAIL [fdo#107815] / [fdo#108145] -> PASS
* igt@kms_plane_multiple@atomic-pipe-a-tiling-y:
- shard-apl: FAIL [fdo#103166] -> PASS
* igt@kms_rotation_crc@multiplane-rotation-cropping-top:
- shard-kbl: DMESG-WARN [fdo#105604] -> PASS
* igt@kms_setmode@basic:
- shard-apl: FAIL [fdo#99912] -> PASS
- shard-kbl: FAIL [fdo#99912] -> PASS
* igt@pm_rpm@gem-evict-pwrite:
- shard-iclb: DMESG-WARN [fdo#107724] -> PASS +7
* igt@pm_rpm@legacy-planes:
- shard-iclb: DMESG-WARN [fdo#108654] -> PASS
* igt@pm_rpm@modeset-non-lpsp-stress-no-wait:
- shard-iclb: INCOMPLETE [fdo#108840] -> SKIP
* igt@pm_rpm@modeset-pc8-residency-stress:
- shard-skl: INCOMPLETE [fdo#107807] -> SKIP
#### Warnings ####
* igt@gem_ppgtt@blt-vs-render-ctx0:
- shard-skl: TIMEOUT [fdo#108039] -> INCOMPLETE [fdo#106887]
* igt@i915_suspend@shrink:
- shard-skl: DMESG-WARN [fdo#108784] -> INCOMPLETE [fdo#106886]
* igt@kms_cursor_crc@cursor-256x85-sliding:
- shard-iclb: FAIL [fdo#103232] -> DMESG-WARN [fdo#107724] / [fdo#108336]
* igt@kms_plane@plane-position-covered-pipe-b-planes:
- shard-iclb: FAIL [fdo#103166] -> DMESG-WARN [fdo#107724] / [fdo#108336] +1
[fdo#100047]: https://bugs.freedesktop.org/show_bug.cgi?id=100047
[fdo#102670]: https://bugs.freedesktop.org/show_bug.cgi?id=102670
[fdo#103060]: https://bugs.freedesktop.org/show_bug.cgi?id=103060
[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#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#105604]: https://bugs.freedesktop.org/show_bug.cgi?id=105604
[fdo#106081]: https://bugs.freedesktop.org/show_bug.cgi?id=106081
[fdo#106886]: https://bugs.freedesktop.org/show_bug.cgi?id=106886
[fdo#106887]: https://bugs.freedesktop.org/show_bug.cgi?id=106887
[fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#107725]: https://bugs.freedesktop.org/show_bug.cgi?id=107725
[fdo#107807]: https://bugs.freedesktop.org/show_bug.cgi?id=107807
[fdo#107815]: https://bugs.freedesktop.org/show_bug.cgi?id=107815
[fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
[fdo#108039]: https://bugs.freedesktop.org/show_bug.cgi?id=108039
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108147]: https://bugs.freedesktop.org/show_bug.cgi?id=108147
[fdo#108336]: https://bugs.freedesktop.org/show_bug.cgi?id=108336
[fdo#108654]: https://bugs.freedesktop.org/show_bug.cgi?id=108654
[fdo#108784]: https://bugs.freedesktop.org/show_bug.cgi?id=108784
[fdo#108840]: https://bugs.freedesktop.org/show_bug.cgi?id=108840
[fdo#108887]: https://bugs.freedesktop.org/show_bug.cgi?id=108887
[fdo#108948]: https://bugs.freedesktop.org/show_bug.cgi?id=108948
[fdo#109097]: https://bugs.freedesktop.org/show_bug.cgi?id=109097
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
Participating hosts (7 -> 7)
------------------------------
No changes in participating hosts
Build changes
-------------
* Linux: CI_DRM_5331 -> Patchwork_11117
CI_DRM_5331: 9373de80d37b523811cea7cfbf4de7b996096bcd @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4749: 270da20849db4d170db09673c6b67712c90ec9fe @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_11117: b1f633593bbd31aac725ce3d091aee6a94a77398 @ 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_11117/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v4 1/2] drm: Add color management LUT validation helper (v4)
2018-12-17 22:44 [PATCH v4 1/2] drm: Add color management LUT validation helper (v4) Matt Roper
` (5 preceding siblings ...)
2018-12-19 10:43 ` ✓ Fi.CI.IGT: success " Patchwork
@ 2019-01-11 22:27 ` Matt Roper
2019-01-12 12:07 ` Daniel Vetter
6 siblings, 1 reply; 13+ messages in thread
From: Matt Roper @ 2019-01-11 22:27 UTC (permalink / raw)
To: dri-devel, intel-gfx, Daniel Vetter, Dave Airlie
Cc: Uma Shankar, Swati Sharma
Dave, Daniel - any concerns if we merge this drm core patch through the
Intel tree? The second patch in the series doesn't apply cleanly in
drm-misc-next.
Matt
On Mon, Dec 17, 2018 at 02:44:14PM -0800, Matt Roper wrote:
> Some hardware may place additional restrictions on the gamma/degamma
> curves described by our LUT properties. E.g., that a gamma curve never
> decreases or that the red/green/blue channels of a LUT's entries must be
> equal. Let's add a helper function that drivers can use to test that a
> userspace-provided LUT is valid and doesn't violate hardware
> requirements.
>
> v2:
> - Combine into a single helper that just takes a bitmask of the tests
> to apply. (Brian Starkey)
> - Add additional check (always performed) that LUT property blob size
> is always a multiple of the LUT entry size. (stolen from ARM driver)
>
> v3:
> - Drop the LUT size check again since
> drm_atomic_replace_property_blob_from_id() already covers this for
> us. (Alexandru Gheorghe)
>
> v4:
> - Use an enum to describe possible test values rather than #define's;
> this is cleaner to provide kerneldoc for. (Daniel Vetter)
> - s/DRM_COLOR_LUT_INCREASING/DRM_COLOR_LUT_NON_DECREASING/. (Ville)
>
> Cc: Uma Shankar <uma.shankar@intel.com>
> Cc: Swati Sharma <swati2.sharma@intel.com>
> Cc: Brian Starkey <Brian.Starkey@arm.com>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
> Reviewed-by(v1): Brian Starkey <brian.starkey@arm.com>
> Reviewed-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>
> Reviewed-by: Uma Shankar <uma.shankar@intel.com>
> ---
> drivers/gpu/drm/drm_color_mgmt.c | 44 ++++++++++++++++++++++++++++++++++++++++
> include/drm/drm_color_mgmt.h | 29 ++++++++++++++++++++++++++
> 2 files changed, 73 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_color_mgmt.c b/drivers/gpu/drm/drm_color_mgmt.c
> index 07dcf47daafe..968ca7c91ad8 100644
> --- a/drivers/gpu/drm/drm_color_mgmt.c
> +++ b/drivers/gpu/drm/drm_color_mgmt.c
> @@ -462,3 +462,47 @@ int drm_plane_create_color_properties(struct drm_plane *plane,
> return 0;
> }
> EXPORT_SYMBOL(drm_plane_create_color_properties);
> +
> +/**
> + * drm_color_lut_check - check validity of lookup table
> + * @lut: property blob containing LUT to check
> + * @tests: bitmask of tests to run
> + *
> + * Helper to check whether a userspace-provided lookup table is valid and
> + * satisfies hardware requirements. Drivers pass a bitmask indicating which of
> + * the tests in &drm_color_lut_tests should be performed.
> + *
> + * Returns 0 on success, -EINVAL on failure.
> + */
> +int drm_color_lut_check(struct drm_property_blob *lut,
> + uint32_t tests)
> +{
> + struct drm_color_lut *entry;
> + int i;
> +
> + if (!lut || !tests)
> + return 0;
> +
> + entry = lut->data;
> + for (i = 0; i < drm_color_lut_size(lut); i++) {
> + if (tests & DRM_COLOR_LUT_EQUAL_CHANNELS) {
> + if (entry[i].red != entry[i].blue ||
> + entry[i].red != entry[i].green) {
> + DRM_DEBUG_KMS("All LUT entries must have equal r/g/b\n");
> + return -EINVAL;
> + }
> + }
> +
> + if (i > 0 && tests & DRM_COLOR_LUT_NON_DECREASING) {
> + if (entry[i].red < entry[i - 1].red ||
> + entry[i].green < entry[i - 1].green ||
> + entry[i].blue < entry[i - 1].blue) {
> + DRM_DEBUG_KMS("LUT entries must never decrease.\n");
> + return -EINVAL;
> + }
> + }
> + }
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(drm_color_lut_check);
> diff --git a/include/drm/drm_color_mgmt.h b/include/drm/drm_color_mgmt.h
> index 90ef9996d9a4..6affbda6d9cb 100644
> --- a/include/drm/drm_color_mgmt.h
> +++ b/include/drm/drm_color_mgmt.h
> @@ -69,4 +69,33 @@ int drm_plane_create_color_properties(struct drm_plane *plane,
> u32 supported_ranges,
> enum drm_color_encoding default_encoding,
> enum drm_color_range default_range);
> +
> +/**
> + * enum drm_color_lut_tests - hw-specific LUT tests to perform
> + *
> + * The drm_color_lut_check() function takes a bitmask of the values here to
> + * determine which tests to apply to a userspace-provided LUT.
> + */
> +enum drm_color_lut_tests {
> + /**
> + * @DRM_COLOR_LUT_EQUAL_CHANNELS:
> + *
> + * Checks whether the entries of a LUT all have equal values for the
> + * red, green, and blue channels. Intended for hardware that only
> + * accepts a single value per LUT entry and assumes that value applies
> + * to all three color components.
> + */
> + DRM_COLOR_LUT_EQUAL_CHANNELS = BIT(0),
> +
> + /**
> + * @DRM_COLOR_LUT_NON_DECREASING:
> + *
> + * Checks whether the entries of a LUT are always flat or increasing
> + * (never decreasing).
> + */
> + DRM_COLOR_LUT_NON_DECREASING = BIT(1),
> +};
> +
> +int drm_color_lut_check(struct drm_property_blob *lut,
> + uint32_t tests);
> #endif
> --
> 2.14.4
>
--
Matt Roper
Graphics Software Engineer
IoTG Platform Enabling & Development
Intel Corporation
(916) 356-2795
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v4 1/2] drm: Add color management LUT validation helper (v4)
2019-01-11 22:27 ` [PATCH v4 1/2] drm: Add color management LUT validation helper (v4) Matt Roper
@ 2019-01-12 12:07 ` Daniel Vetter
2019-01-24 0:44 ` Matt Roper
0 siblings, 1 reply; 13+ messages in thread
From: Daniel Vetter @ 2019-01-12 12:07 UTC (permalink / raw)
To: Matt Roper; +Cc: intel-gfx, dri-devel
On Fri, Jan 11, 2019 at 02:27:00PM -0800, Matt Roper wrote:
> Dave, Daniel - any concerns if we merge this drm core patch through the
> Intel tree? The second patch in the series doesn't apply cleanly in
> drm-misc-next.
Hm, need to discuss with Dave how good my ack powers are now. In the past
we had the rule that I asked him for an explicit ack, but back then I was
still maintainer of i915, so a bit a too obvious conflict there. I think
with the separate roles me acking should be good enough.
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Dave, sounds reasonable?
-Daniel
>
>
> Matt
>
>
> On Mon, Dec 17, 2018 at 02:44:14PM -0800, Matt Roper wrote:
> > Some hardware may place additional restrictions on the gamma/degamma
> > curves described by our LUT properties. E.g., that a gamma curve never
> > decreases or that the red/green/blue channels of a LUT's entries must be
> > equal. Let's add a helper function that drivers can use to test that a
> > userspace-provided LUT is valid and doesn't violate hardware
> > requirements.
> >
> > v2:
> > - Combine into a single helper that just takes a bitmask of the tests
> > to apply. (Brian Starkey)
> > - Add additional check (always performed) that LUT property blob size
> > is always a multiple of the LUT entry size. (stolen from ARM driver)
> >
> > v3:
> > - Drop the LUT size check again since
> > drm_atomic_replace_property_blob_from_id() already covers this for
> > us. (Alexandru Gheorghe)
> >
> > v4:
> > - Use an enum to describe possible test values rather than #define's;
> > this is cleaner to provide kerneldoc for. (Daniel Vetter)
> > - s/DRM_COLOR_LUT_INCREASING/DRM_COLOR_LUT_NON_DECREASING/. (Ville)
> >
> > Cc: Uma Shankar <uma.shankar@intel.com>
> > Cc: Swati Sharma <swati2.sharma@intel.com>
> > Cc: Brian Starkey <Brian.Starkey@arm.com>
> > Cc: Daniel Vetter <daniel@ffwll.ch>
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
> > Reviewed-by(v1): Brian Starkey <brian.starkey@arm.com>
> > Reviewed-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>
> > Reviewed-by: Uma Shankar <uma.shankar@intel.com>
> > ---
> > drivers/gpu/drm/drm_color_mgmt.c | 44 ++++++++++++++++++++++++++++++++++++++++
> > include/drm/drm_color_mgmt.h | 29 ++++++++++++++++++++++++++
> > 2 files changed, 73 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/drm_color_mgmt.c b/drivers/gpu/drm/drm_color_mgmt.c
> > index 07dcf47daafe..968ca7c91ad8 100644
> > --- a/drivers/gpu/drm/drm_color_mgmt.c
> > +++ b/drivers/gpu/drm/drm_color_mgmt.c
> > @@ -462,3 +462,47 @@ int drm_plane_create_color_properties(struct drm_plane *plane,
> > return 0;
> > }
> > EXPORT_SYMBOL(drm_plane_create_color_properties);
> > +
> > +/**
> > + * drm_color_lut_check - check validity of lookup table
> > + * @lut: property blob containing LUT to check
> > + * @tests: bitmask of tests to run
> > + *
> > + * Helper to check whether a userspace-provided lookup table is valid and
> > + * satisfies hardware requirements. Drivers pass a bitmask indicating which of
> > + * the tests in &drm_color_lut_tests should be performed.
> > + *
> > + * Returns 0 on success, -EINVAL on failure.
> > + */
> > +int drm_color_lut_check(struct drm_property_blob *lut,
> > + uint32_t tests)
> > +{
> > + struct drm_color_lut *entry;
> > + int i;
> > +
> > + if (!lut || !tests)
> > + return 0;
> > +
> > + entry = lut->data;
> > + for (i = 0; i < drm_color_lut_size(lut); i++) {
> > + if (tests & DRM_COLOR_LUT_EQUAL_CHANNELS) {
> > + if (entry[i].red != entry[i].blue ||
> > + entry[i].red != entry[i].green) {
> > + DRM_DEBUG_KMS("All LUT entries must have equal r/g/b\n");
> > + return -EINVAL;
> > + }
> > + }
> > +
> > + if (i > 0 && tests & DRM_COLOR_LUT_NON_DECREASING) {
> > + if (entry[i].red < entry[i - 1].red ||
> > + entry[i].green < entry[i - 1].green ||
> > + entry[i].blue < entry[i - 1].blue) {
> > + DRM_DEBUG_KMS("LUT entries must never decrease.\n");
> > + return -EINVAL;
> > + }
> > + }
> > + }
> > +
> > + return 0;
> > +}
> > +EXPORT_SYMBOL(drm_color_lut_check);
> > diff --git a/include/drm/drm_color_mgmt.h b/include/drm/drm_color_mgmt.h
> > index 90ef9996d9a4..6affbda6d9cb 100644
> > --- a/include/drm/drm_color_mgmt.h
> > +++ b/include/drm/drm_color_mgmt.h
> > @@ -69,4 +69,33 @@ int drm_plane_create_color_properties(struct drm_plane *plane,
> > u32 supported_ranges,
> > enum drm_color_encoding default_encoding,
> > enum drm_color_range default_range);
> > +
> > +/**
> > + * enum drm_color_lut_tests - hw-specific LUT tests to perform
> > + *
> > + * The drm_color_lut_check() function takes a bitmask of the values here to
> > + * determine which tests to apply to a userspace-provided LUT.
> > + */
> > +enum drm_color_lut_tests {
> > + /**
> > + * @DRM_COLOR_LUT_EQUAL_CHANNELS:
> > + *
> > + * Checks whether the entries of a LUT all have equal values for the
> > + * red, green, and blue channels. Intended for hardware that only
> > + * accepts a single value per LUT entry and assumes that value applies
> > + * to all three color components.
> > + */
> > + DRM_COLOR_LUT_EQUAL_CHANNELS = BIT(0),
> > +
> > + /**
> > + * @DRM_COLOR_LUT_NON_DECREASING:
> > + *
> > + * Checks whether the entries of a LUT are always flat or increasing
> > + * (never decreasing).
> > + */
> > + DRM_COLOR_LUT_NON_DECREASING = BIT(1),
> > +};
> > +
> > +int drm_color_lut_check(struct drm_property_blob *lut,
> > + uint32_t tests);
> > #endif
> > --
> > 2.14.4
> >
>
> --
> Matt Roper
> Graphics Software Engineer
> IoTG Platform Enabling & Development
> Intel Corporation
> (916) 356-2795
--
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] 13+ messages in thread
* Re: [PATCH v4 1/2] drm: Add color management LUT validation helper (v4)
2019-01-12 12:07 ` Daniel Vetter
@ 2019-01-24 0:44 ` Matt Roper
0 siblings, 0 replies; 13+ messages in thread
From: Matt Roper @ 2019-01-24 0:44 UTC (permalink / raw)
To: Daniel Vetter; +Cc: intel-gfx, Swati Sharma, Uma Shankar, dri-devel
On Sat, Jan 12, 2019 at 01:07:14PM +0100, Daniel Vetter wrote:
> On Fri, Jan 11, 2019 at 02:27:00PM -0800, Matt Roper wrote:
> > Dave, Daniel - any concerns if we merge this drm core patch through the
> > Intel tree? The second patch in the series doesn't apply cleanly in
> > drm-misc-next.
>
> Hm, need to discuss with Dave how good my ack powers are now. In the past
> we had the rule that I asked him for an explicit ack, but back then I was
> still maintainer of i915, so a bit a too obvious conflict there. I think
> with the separate roles me acking should be good enough.
>
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> Dave, sounds reasonable?
> -Daniel
Dave confirmed on IRC that Daniel's ack here is sufficient. Merged both
patches through the Intel tree (dinq); thanks everyone for the reviews.
Matt
>
> >
> >
> > Matt
> >
> >
> > On Mon, Dec 17, 2018 at 02:44:14PM -0800, Matt Roper wrote:
> > > Some hardware may place additional restrictions on the gamma/degamma
> > > curves described by our LUT properties. E.g., that a gamma curve never
> > > decreases or that the red/green/blue channels of a LUT's entries must be
> > > equal. Let's add a helper function that drivers can use to test that a
> > > userspace-provided LUT is valid and doesn't violate hardware
> > > requirements.
> > >
> > > v2:
> > > - Combine into a single helper that just takes a bitmask of the tests
> > > to apply. (Brian Starkey)
> > > - Add additional check (always performed) that LUT property blob size
> > > is always a multiple of the LUT entry size. (stolen from ARM driver)
> > >
> > > v3:
> > > - Drop the LUT size check again since
> > > drm_atomic_replace_property_blob_from_id() already covers this for
> > > us. (Alexandru Gheorghe)
> > >
> > > v4:
> > > - Use an enum to describe possible test values rather than #define's;
> > > this is cleaner to provide kerneldoc for. (Daniel Vetter)
> > > - s/DRM_COLOR_LUT_INCREASING/DRM_COLOR_LUT_NON_DECREASING/. (Ville)
> > >
> > > Cc: Uma Shankar <uma.shankar@intel.com>
> > > Cc: Swati Sharma <swati2.sharma@intel.com>
> > > Cc: Brian Starkey <Brian.Starkey@arm.com>
> > > Cc: Daniel Vetter <daniel@ffwll.ch>
> > > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
> > > Reviewed-by(v1): Brian Starkey <brian.starkey@arm.com>
> > > Reviewed-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>
> > > Reviewed-by: Uma Shankar <uma.shankar@intel.com>
> > > ---
> > > drivers/gpu/drm/drm_color_mgmt.c | 44 ++++++++++++++++++++++++++++++++++++++++
> > > include/drm/drm_color_mgmt.h | 29 ++++++++++++++++++++++++++
> > > 2 files changed, 73 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/drm_color_mgmt.c b/drivers/gpu/drm/drm_color_mgmt.c
> > > index 07dcf47daafe..968ca7c91ad8 100644
> > > --- a/drivers/gpu/drm/drm_color_mgmt.c
> > > +++ b/drivers/gpu/drm/drm_color_mgmt.c
> > > @@ -462,3 +462,47 @@ int drm_plane_create_color_properties(struct drm_plane *plane,
> > > return 0;
> > > }
> > > EXPORT_SYMBOL(drm_plane_create_color_properties);
> > > +
> > > +/**
> > > + * drm_color_lut_check - check validity of lookup table
> > > + * @lut: property blob containing LUT to check
> > > + * @tests: bitmask of tests to run
> > > + *
> > > + * Helper to check whether a userspace-provided lookup table is valid and
> > > + * satisfies hardware requirements. Drivers pass a bitmask indicating which of
> > > + * the tests in &drm_color_lut_tests should be performed.
> > > + *
> > > + * Returns 0 on success, -EINVAL on failure.
> > > + */
> > > +int drm_color_lut_check(struct drm_property_blob *lut,
> > > + uint32_t tests)
> > > +{
> > > + struct drm_color_lut *entry;
> > > + int i;
> > > +
> > > + if (!lut || !tests)
> > > + return 0;
> > > +
> > > + entry = lut->data;
> > > + for (i = 0; i < drm_color_lut_size(lut); i++) {
> > > + if (tests & DRM_COLOR_LUT_EQUAL_CHANNELS) {
> > > + if (entry[i].red != entry[i].blue ||
> > > + entry[i].red != entry[i].green) {
> > > + DRM_DEBUG_KMS("All LUT entries must have equal r/g/b\n");
> > > + return -EINVAL;
> > > + }
> > > + }
> > > +
> > > + if (i > 0 && tests & DRM_COLOR_LUT_NON_DECREASING) {
> > > + if (entry[i].red < entry[i - 1].red ||
> > > + entry[i].green < entry[i - 1].green ||
> > > + entry[i].blue < entry[i - 1].blue) {
> > > + DRM_DEBUG_KMS("LUT entries must never decrease.\n");
> > > + return -EINVAL;
> > > + }
> > > + }
> > > + }
> > > +
> > > + return 0;
> > > +}
> > > +EXPORT_SYMBOL(drm_color_lut_check);
> > > diff --git a/include/drm/drm_color_mgmt.h b/include/drm/drm_color_mgmt.h
> > > index 90ef9996d9a4..6affbda6d9cb 100644
> > > --- a/include/drm/drm_color_mgmt.h
> > > +++ b/include/drm/drm_color_mgmt.h
> > > @@ -69,4 +69,33 @@ int drm_plane_create_color_properties(struct drm_plane *plane,
> > > u32 supported_ranges,
> > > enum drm_color_encoding default_encoding,
> > > enum drm_color_range default_range);
> > > +
> > > +/**
> > > + * enum drm_color_lut_tests - hw-specific LUT tests to perform
> > > + *
> > > + * The drm_color_lut_check() function takes a bitmask of the values here to
> > > + * determine which tests to apply to a userspace-provided LUT.
> > > + */
> > > +enum drm_color_lut_tests {
> > > + /**
> > > + * @DRM_COLOR_LUT_EQUAL_CHANNELS:
> > > + *
> > > + * Checks whether the entries of a LUT all have equal values for the
> > > + * red, green, and blue channels. Intended for hardware that only
> > > + * accepts a single value per LUT entry and assumes that value applies
> > > + * to all three color components.
> > > + */
> > > + DRM_COLOR_LUT_EQUAL_CHANNELS = BIT(0),
> > > +
> > > + /**
> > > + * @DRM_COLOR_LUT_NON_DECREASING:
> > > + *
> > > + * Checks whether the entries of a LUT are always flat or increasing
> > > + * (never decreasing).
> > > + */
> > > + DRM_COLOR_LUT_NON_DECREASING = BIT(1),
> > > +};
> > > +
> > > +int drm_color_lut_check(struct drm_property_blob *lut,
> > > + uint32_t tests);
> > > #endif
> > > --
> > > 2.14.4
> > >
> >
> > --
> > Matt Roper
> > Graphics Software Engineer
> > IoTG Platform Enabling & Development
> > Intel Corporation
> > (916) 356-2795
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
--
Matt Roper
Graphics Software Engineer
IoTG Platform Enabling & Development
Intel Corporation
(916) 356-2795
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v4 2/2] drm/i915: Validate userspace-provided color management LUT's (v4)
2018-12-18 17:51 ` [PATCH v4 2/2] drm/i915: Validate userspace-provided color management LUT's (v4) Matt Roper
@ 2019-01-25 20:00 ` Ville Syrjälä
0 siblings, 0 replies; 13+ messages in thread
From: Ville Syrjälä @ 2019-01-25 20:00 UTC (permalink / raw)
To: Matt Roper; +Cc: intel-gfx
On Tue, Dec 18, 2018 at 09:51:58AM -0800, Matt Roper wrote:
> We currently program userspace-provided gamma and degamma LUT's into our
> hardware without really checking to see whether they satisfy our
> hardware's rules. We should try to catch tables that are invalid for
> our hardware early and reject the atomic transaction.
>
> All of our platforms that accept a degamma LUT expect that the entries
> in the LUT are always flat or increasing, never decreasing. Also, our
> GLK and ICL platforms only accept degamma tables with r=g=b entries; so
> we should also add the relevant checks for that in anticipation of
> degamma support landing for those platforms.
>
> v2:
> - Use new API (single check function with bitmask of tests to apply)
> - Call helper for our gamma table as well (with no additional tests
> specified) so that the table size will be validated.
>
> v3:
> - Don't call on the gamma table since the LUT size is already tested at
> property blob upload and we don't have any additional hardware
> constraints for that LUT.
>
> v4:
> - Apply equal color channel check on gen10 as well; the bspec has some
> strange tagging for CNL platforms, but this appears to apply there as
> well. (Ville)
>
> Cc: Uma Shankar <uma.shankar@intel.com>
> Cc: Swati Sharma <swati2.sharma@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
> Reviewed-by: Uma Shankar <uma.shankar@intel.com>
> ---
> drivers/gpu/drm/i915/intel_color.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_color.c b/drivers/gpu/drm/i915/intel_color.c
> index 37fd9ddf762e..e3ffbb0ad9a6 100644
> --- a/drivers/gpu/drm/i915/intel_color.c
> +++ b/drivers/gpu/drm/i915/intel_color.c
> @@ -609,10 +609,26 @@ int intel_color_check(struct intel_crtc_state *crtc_state)
> {
> struct drm_i915_private *dev_priv = to_i915(crtc_state->base.crtc->dev);
> size_t gamma_length, degamma_length;
> + uint32_t tests = DRM_COLOR_LUT_NON_DECREASING;
>
> degamma_length = INTEL_INFO(dev_priv)->color.degamma_lut_size;
> gamma_length = INTEL_INFO(dev_priv)->color.gamma_lut_size;
>
> + /*
> + * All of our platforms mandate that the degamma curve be
> + * non-decreasing.
This is actually not true. Only interpolated gamma modes require a
non-decreasing curve. The split gamma mode used on pre-glk is not
interpolated.
Also both CHV CGM gamma and degamma are interpolated, so we should
rather be checking gamma as well here.
> Additionally, GLK and gen11 only accept a single
> + * value for red, green, and blue in the degamma table. Make sure
> + * userspace didn't try to pass us something we can't handle.
> + *
> + * We don't have any extra hardware constraints on the gamma table,
> + * so no need to explicitly check it.
> + */
> + if (IS_GEMINILAKE(dev_priv) || INTEL_GEN(dev_priv) >= 10)
> + tests |= DRM_COLOR_LUT_EQUAL_CHANNELS;
> +
> + if (drm_color_lut_check(crtc_state->base.degamma_lut, tests) != 0)
> + return -EINVAL;
> +
> /*
> * We allow both degamma & gamma luts at the right size or
> * NULL.
> --
> 2.14.4
--
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] 13+ messages in thread
end of thread, other threads:[~2019-01-25 20:00 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-17 22:44 [PATCH v4 1/2] drm: Add color management LUT validation helper (v4) Matt Roper
2018-12-17 22:44 ` [PATCH v4 2/2] drm/i915: Validate userspace-provided color management LUT's (v3) Matt Roper
2018-12-18 14:04 ` Ville Syrjälä
2018-12-18 17:51 ` [PATCH v4 2/2] drm/i915: Validate userspace-provided color management LUT's (v4) Matt Roper
2019-01-25 20:00 ` Ville Syrjälä
2018-12-17 23:16 ` ✓ Fi.CI.BAT: success for series starting with [v4,1/2] drm: Add color management LUT validation helper (v4) Patchwork
2018-12-18 1:55 ` ✓ Fi.CI.IGT: " Patchwork
2018-12-18 18:30 ` ✓ Fi.CI.BAT: success for series starting with [v4,1/2] drm: Add color management LUT validation helper (v4) (rev2) Patchwork
2018-12-19 1:27 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-12-19 10:43 ` ✓ Fi.CI.IGT: success " Patchwork
2019-01-11 22:27 ` [PATCH v4 1/2] drm: Add color management LUT validation helper (v4) Matt Roper
2019-01-12 12:07 ` Daniel Vetter
2019-01-24 0:44 ` Matt Roper
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.