aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2018-02-02 15:42:31 -0500
committerVille Syrjälä <ville.syrjala@linux.intel.com>2018-02-05 13:54:01 -0500
commit6ec5bd348934887494541bcc9b53d621b1f2962c (patch)
treeb95b8ce404dcb6e931617f36cb7000c9c639e488
parent01b8fdc5222007bdfc905941173f82576898a7f7 (diff)
drm/i915: Deprecate I915_SET_COLORKEY_NONE
Deprecate the silly I915_SET_COLORKEY_NONE flag. The obvious way to disable colorkey is to just set flags to 0, which is exactly what the intel ddx has been doing all along. Currently when userspace sets the flags to 0, we end up in a funny state where colorkey is disabled, but various colorkey vs. scaling checks still consider colorkey to be enabled, and thus we don't allow plane scaling to kick in. In case there is some other userspace out there that actually uses this flag (unlikely as this is an i915 specific uapi) we'll keep on accepting it. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180202204231.27905-1-ville.syrjala@linux.intel.com Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--drivers/gpu/drm/i915/intel_atomic_plane.c1
-rw-r--r--drivers/gpu/drm/i915/intel_display.c4
-rw-r--r--drivers/gpu/drm/i915/intel_sprite.c5
-rw-r--r--include/uapi/drm/i915_drm.h4
4 files changed, 9 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
index 8e6dc159f64d..57ee8b786cd8 100644
--- a/drivers/gpu/drm/i915/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
@@ -56,7 +56,6 @@ intel_create_plane_state(struct drm_plane *plane)
56 56
57 state->base.plane = plane; 57 state->base.plane = plane;
58 state->base.rotation = DRM_MODE_ROTATE_0; 58 state->base.rotation = DRM_MODE_ROTATE_0;
59 state->ckey.flags = I915_SET_COLORKEY_NONE;
60 59
61 return state; 60 return state;
62} 61}
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e79b9242eb66..e9bba2ab4904 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4787,7 +4787,7 @@ static int skl_update_scaler_plane(struct intel_crtc_state *crtc_state,
4787 return ret; 4787 return ret;
4788 4788
4789 /* check colorkey */ 4789 /* check colorkey */
4790 if (plane_state->ckey.flags != I915_SET_COLORKEY_NONE) { 4790 if (plane_state->ckey.flags) {
4791 DRM_DEBUG_KMS("[PLANE:%d:%s] scaling with color key not allowed", 4791 DRM_DEBUG_KMS("[PLANE:%d:%s] scaling with color key not allowed",
4792 intel_plane->base.base.id, 4792 intel_plane->base.base.id,
4793 intel_plane->base.name); 4793 intel_plane->base.name);
@@ -12788,7 +12788,7 @@ intel_check_primary_plane(struct intel_plane *plane,
12788 12788
12789 if (INTEL_GEN(dev_priv) >= 9) { 12789 if (INTEL_GEN(dev_priv) >= 9) {
12790 /* use scaler when colorkey is not required */ 12790 /* use scaler when colorkey is not required */
12791 if (state->ckey.flags == I915_SET_COLORKEY_NONE) { 12791 if (!state->ckey.flags) {
12792 min_scale = 1; 12792 min_scale = 1;
12793 max_scale = skl_max_scale(to_intel_crtc(crtc), crtc_state); 12793 max_scale = skl_max_scale(to_intel_crtc(crtc), crtc_state);
12794 } 12794 }
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 630d20eecf3c..32f10621fac8 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -894,7 +894,7 @@ intel_check_sprite_plane(struct intel_plane *plane,
894 /* setup can_scale, min_scale, max_scale */ 894 /* setup can_scale, min_scale, max_scale */
895 if (INTEL_GEN(dev_priv) >= 9) { 895 if (INTEL_GEN(dev_priv) >= 9) {
896 /* use scaler when colorkey is not required */ 896 /* use scaler when colorkey is not required */
897 if (state->ckey.flags == I915_SET_COLORKEY_NONE) { 897 if (!state->ckey.flags) {
898 can_scale = 1; 898 can_scale = 1;
899 min_scale = 1; 899 min_scale = 1;
900 max_scale = skl_max_scale(crtc, crtc_state); 900 max_scale = skl_max_scale(crtc, crtc_state);
@@ -1070,6 +1070,9 @@ int intel_sprite_set_colorkey(struct drm_device *dev, void *data,
1070 struct drm_modeset_acquire_ctx ctx; 1070 struct drm_modeset_acquire_ctx ctx;
1071 int ret = 0; 1071 int ret = 0;
1072 1072
1073 /* ignore the pointless "none" flag */
1074 set->flags &= ~I915_SET_COLORKEY_NONE;
1075
1073 /* Make sure we don't try to enable both src & dest simultaneously */ 1076 /* Make sure we don't try to enable both src & dest simultaneously */
1074 if ((set->flags & (I915_SET_COLORKEY_DESTINATION | I915_SET_COLORKEY_SOURCE)) == (I915_SET_COLORKEY_DESTINATION | I915_SET_COLORKEY_SOURCE)) 1077 if ((set->flags & (I915_SET_COLORKEY_DESTINATION | I915_SET_COLORKEY_SOURCE)) == (I915_SET_COLORKEY_DESTINATION | I915_SET_COLORKEY_SOURCE))
1075 return -EINVAL; 1078 return -EINVAL;
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 536ee4febd74..29fa48e4755d 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -1358,7 +1358,9 @@ struct drm_intel_overlay_attrs {
1358 * active on a given plane. 1358 * active on a given plane.
1359 */ 1359 */
1360 1360
1361#define I915_SET_COLORKEY_NONE (1<<0) /* disable color key matching */ 1361#define I915_SET_COLORKEY_NONE (1<<0) /* Deprecated. Instead set
1362 * flags==0 to disable colorkeying.
1363 */
1362#define I915_SET_COLORKEY_DESTINATION (1<<1) 1364#define I915_SET_COLORKEY_DESTINATION (1<<1)
1363#define I915_SET_COLORKEY_SOURCE (1<<2) 1365#define I915_SET_COLORKEY_SOURCE (1<<2)
1364struct drm_intel_sprite_colorkey { 1366struct drm_intel_sprite_colorkey {