Re: [Intel-gfx] [PATCH 9/9] drm/simple_kms_helper: Use drm_plane_helper_check_state()

2016-08-01 Thread Sean Paul
On Tue, Jul 26, 2016 at 12:07 PM,   wrote:
> From: Ville Syrjälä 
>
> Replace the use of drm_plane_helper_check_update() with
> drm_plane_helper_check_state() since we have a plane state.
>
> I don't see any actual users of drm_simple_kms_helper yet, so
> no actual plane clipping bugs to fix.
>
> Cc: Noralf Trønnes 
> Signed-off-by: Ville Syrjälä 


Reviewed-by: Sean Paul 

> ---
>  drivers/gpu/drm/drm_simple_kms_helper.c | 27 ++-
>  1 file changed, 6 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c 
> b/drivers/gpu/drm/drm_simple_kms_helper.c
> index 0db36d27e90b..0a02efe978ee 100644
> --- a/drivers/gpu/drm/drm_simple_kms_helper.c
> +++ b/drivers/gpu/drm/drm_simple_kms_helper.c
> @@ -73,22 +73,9 @@ static const struct drm_crtc_funcs 
> drm_simple_kms_crtc_funcs = {
>  static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane,
> struct drm_plane_state *plane_state)
>  {
> -   struct drm_rect src = {
> -   .x1 = plane_state->src_x,
> -   .y1 = plane_state->src_y,
> -   .x2 = plane_state->src_x + plane_state->src_w,
> -   .y2 = plane_state->src_y + plane_state->src_h,
> -   };
> -   struct drm_rect dest = {
> -   .x1 = plane_state->crtc_x,
> -   .y1 = plane_state->crtc_y,
> -   .x2 = plane_state->crtc_x + plane_state->crtc_w,
> -   .y2 = plane_state->crtc_y + plane_state->crtc_h,
> -   };
> struct drm_rect clip = { 0 };
> struct drm_simple_display_pipe *pipe;
> struct drm_crtc_state *crtc_state;
> -   bool visible;
> int ret;
>
> pipe = container_of(plane, struct drm_simple_display_pipe, plane);
> @@ -102,17 +89,15 @@ static int drm_simple_kms_plane_atomic_check(struct 
> drm_plane *plane,
>
> clip.x2 = crtc_state->adjusted_mode.hdisplay;
> clip.y2 = crtc_state->adjusted_mode.vdisplay;
> -   ret = drm_plane_helper_check_update(plane, >crtc,
> -   plane_state->fb,
> -   , , ,
> -   plane_state->rotation,
> -   DRM_PLANE_HELPER_NO_SCALING,
> -   DRM_PLANE_HELPER_NO_SCALING,
> -   false, true, );
> +
> +   ret = drm_plane_helper_check_state(plane_state, ,
> +  DRM_PLANE_HELPER_NO_SCALING,
> +  DRM_PLANE_HELPER_NO_SCALING,
> +  false, true);
> if (ret)
> return ret;
>
> -   if (!visible)
> +   if (!plane_state->visible)
> return -EINVAL;
>
> if (!pipe->funcs || !pipe->funcs->check)
> --
> 2.7.4
>
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 9/9] drm/simple_kms_helper: Use drm_plane_helper_check_state()

2016-07-26 Thread ville . syrjala
From: Ville Syrjälä 

Replace the use of drm_plane_helper_check_update() with
drm_plane_helper_check_state() since we have a plane state.

I don't see any actual users of drm_simple_kms_helper yet, so
no actual plane clipping bugs to fix.

Cc: Noralf Trønnes 
Signed-off-by: Ville Syrjälä 
---
 drivers/gpu/drm/drm_simple_kms_helper.c | 27 ++-
 1 file changed, 6 insertions(+), 21 deletions(-)

diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c 
b/drivers/gpu/drm/drm_simple_kms_helper.c
index 0db36d27e90b..0a02efe978ee 100644
--- a/drivers/gpu/drm/drm_simple_kms_helper.c
+++ b/drivers/gpu/drm/drm_simple_kms_helper.c
@@ -73,22 +73,9 @@ static const struct drm_crtc_funcs drm_simple_kms_crtc_funcs 
= {
 static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane,
struct drm_plane_state *plane_state)
 {
-   struct drm_rect src = {
-   .x1 = plane_state->src_x,
-   .y1 = plane_state->src_y,
-   .x2 = plane_state->src_x + plane_state->src_w,
-   .y2 = plane_state->src_y + plane_state->src_h,
-   };
-   struct drm_rect dest = {
-   .x1 = plane_state->crtc_x,
-   .y1 = plane_state->crtc_y,
-   .x2 = plane_state->crtc_x + plane_state->crtc_w,
-   .y2 = plane_state->crtc_y + plane_state->crtc_h,
-   };
struct drm_rect clip = { 0 };
struct drm_simple_display_pipe *pipe;
struct drm_crtc_state *crtc_state;
-   bool visible;
int ret;
 
pipe = container_of(plane, struct drm_simple_display_pipe, plane);
@@ -102,17 +89,15 @@ static int drm_simple_kms_plane_atomic_check(struct 
drm_plane *plane,
 
clip.x2 = crtc_state->adjusted_mode.hdisplay;
clip.y2 = crtc_state->adjusted_mode.vdisplay;
-   ret = drm_plane_helper_check_update(plane, >crtc,
-   plane_state->fb,
-   , , ,
-   plane_state->rotation,
-   DRM_PLANE_HELPER_NO_SCALING,
-   DRM_PLANE_HELPER_NO_SCALING,
-   false, true, );
+
+   ret = drm_plane_helper_check_state(plane_state, ,
+  DRM_PLANE_HELPER_NO_SCALING,
+  DRM_PLANE_HELPER_NO_SCALING,
+  false, true);
if (ret)
return ret;
 
-   if (!visible)
+   if (!plane_state->visible)
return -EINVAL;
 
if (!pipe->funcs || !pipe->funcs->check)
-- 
2.7.4

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