diff mbox

[03/21] drm/i915: Enable get_colorkey functions for primary plane.

Message ID 1426398946-5900-4-git-send-email-chandra.konduru@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Chandra Konduru March 15, 2015, 5:55 a.m. UTC
Made intel_colorkey_enabled and skl_get_colorkey functions
available for primary plane.

Signed-off-by: Chandra Konduru <chandra.konduru@intel.com>
---
 drivers/gpu/drm/i915/intel_drv.h    |    3 +++
 drivers/gpu/drm/i915/intel_sprite.c |    9 +++++----
 2 files changed, 8 insertions(+), 4 deletions(-)

Comments

Daniel Vetter March 17, 2015, 2:12 p.m. UTC | #1
On Sat, Mar 14, 2015 at 10:55:28PM -0700, Chandra Konduru wrote:
> Made intel_colorkey_enabled and skl_get_colorkey functions
> available for primary plane.
> 
> Signed-off-by: Chandra Konduru <chandra.konduru@intel.com>

This is a legacy plane attribute which we first need to convert over to
properties. Do we really need this for skl scaler support? The problem
here is that this directly looks at hw state, so breaks the check/commit
split atomic needs.

Imo best would be if we could push this ouf of the scaler series. I
haven't checked for usage though.
-Daniel

> ---
>  drivers/gpu/drm/i915/intel_drv.h    |    3 +++
>  drivers/gpu/drm/i915/intel_sprite.c |    9 +++++----
>  2 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index ec99046..3f7d05e 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1263,6 +1263,9 @@ int intel_sprite_set_colorkey(struct drm_device *dev, void *data,
>  			      struct drm_file *file_priv);
>  int intel_sprite_get_colorkey(struct drm_device *dev, void *data,
>  			      struct drm_file *file_priv);
> +bool intel_colorkey_enabled(struct intel_plane *intel_plane);
> +void skl_get_colorkey(struct drm_plane *drm_plane,
> +                struct drm_intel_sprite_colorkey *key);
>  bool intel_pipe_update_start(struct intel_crtc *crtc,
>  			     uint32_t *start_vbl_count);
>  void intel_pipe_update_end(struct intel_crtc *crtc, u32 start_vbl_count);
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> index a828736..9ee12d0 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -336,7 +336,7 @@ skl_update_colorkey(struct drm_plane *drm_plane,
>  	return 0;
>  }
>  
> -static void
> +void
>  skl_get_colorkey(struct drm_plane *drm_plane,
>  		 struct drm_intel_sprite_colorkey *key)
>  {
> @@ -1068,11 +1068,12 @@ ilk_get_colorkey(struct drm_plane *plane, struct drm_intel_sprite_colorkey *key)
>  		key->flags = I915_SET_COLORKEY_NONE;
>  }
>  
> -static bool colorkey_enabled(struct intel_plane *intel_plane)
> +bool intel_colorkey_enabled(struct intel_plane *intel_plane)
>  {
>  	struct drm_intel_sprite_colorkey key;
>  
> -	intel_plane->get_colorkey(&intel_plane->base, &key);
> +	if (intel_plane->get_colorkey)
> +		intel_plane->get_colorkey(&intel_plane->base, &key);
>  
>  	return key.flags != I915_SET_COLORKEY_NONE;
>  }
> @@ -1241,7 +1242,7 @@ finish:
>  	 * we can disable the primary and save power.
>  	 */
>  	state->hides_primary = fb != NULL && drm_rect_equals(dst, clip) &&
> -		!colorkey_enabled(intel_plane);
> +		!intel_colorkey_enabled(intel_plane);
>  	WARN_ON(state->hides_primary && !state->visible && intel_crtc->active);
>  
>  	if (intel_crtc->active) {
> -- 
> 1.7.9.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index ec99046..3f7d05e 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1263,6 +1263,9 @@  int intel_sprite_set_colorkey(struct drm_device *dev, void *data,
 			      struct drm_file *file_priv);
 int intel_sprite_get_colorkey(struct drm_device *dev, void *data,
 			      struct drm_file *file_priv);
+bool intel_colorkey_enabled(struct intel_plane *intel_plane);
+void skl_get_colorkey(struct drm_plane *drm_plane,
+                struct drm_intel_sprite_colorkey *key);
 bool intel_pipe_update_start(struct intel_crtc *crtc,
 			     uint32_t *start_vbl_count);
 void intel_pipe_update_end(struct intel_crtc *crtc, u32 start_vbl_count);
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index a828736..9ee12d0 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -336,7 +336,7 @@  skl_update_colorkey(struct drm_plane *drm_plane,
 	return 0;
 }
 
-static void
+void
 skl_get_colorkey(struct drm_plane *drm_plane,
 		 struct drm_intel_sprite_colorkey *key)
 {
@@ -1068,11 +1068,12 @@  ilk_get_colorkey(struct drm_plane *plane, struct drm_intel_sprite_colorkey *key)
 		key->flags = I915_SET_COLORKEY_NONE;
 }
 
-static bool colorkey_enabled(struct intel_plane *intel_plane)
+bool intel_colorkey_enabled(struct intel_plane *intel_plane)
 {
 	struct drm_intel_sprite_colorkey key;
 
-	intel_plane->get_colorkey(&intel_plane->base, &key);
+	if (intel_plane->get_colorkey)
+		intel_plane->get_colorkey(&intel_plane->base, &key);
 
 	return key.flags != I915_SET_COLORKEY_NONE;
 }
@@ -1241,7 +1242,7 @@  finish:
 	 * we can disable the primary and save power.
 	 */
 	state->hides_primary = fb != NULL && drm_rect_equals(dst, clip) &&
-		!colorkey_enabled(intel_plane);
+		!intel_colorkey_enabled(intel_plane);
 	WARN_ON(state->hides_primary && !state->visible && intel_crtc->active);
 
 	if (intel_crtc->active) {