diff mbox

[v2,4/6] drm/sti: Let core take care of normalizing the zpos

Message ID 20180112132110.16034-5-peter.ujfalusi@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Peter Ujfalusi Jan. 12, 2018, 1:21 p.m. UTC
Instead of re-implementing the drm_atomic_helper_check() locally with just
adding drm_atomic_normalize_zpos() into it, set the
drm_device->normalize_zpos.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
CC: Benjamin Gaignard <benjamin.gaignard@linaro.org>
CC: Vincent Abriou <vincent.abriou@st.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/sti/sti_drv.c | 24 +++---------------------
 1 file changed, 3 insertions(+), 21 deletions(-)

Comments

Benjamin Gaignard Jan. 12, 2018, 2:07 p.m. UTC | #1
2018-01-12 14:21 GMT+01:00 Peter Ujfalusi <peter.ujfalusi@ti.com>:
> Instead of re-implementing the drm_atomic_helper_check() locally with just
> adding drm_atomic_normalize_zpos() into it, set the
> drm_device->normalize_zpos.
>

Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>

> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> CC: Benjamin Gaignard <benjamin.gaignard@linaro.org>
> CC: Vincent Abriou <vincent.abriou@st.com>
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/sti/sti_drv.c | 24 +++---------------------
>  1 file changed, 3 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
> index 55b6967d27e1..90c46b49c931 100644
> --- a/drivers/gpu/drm/sti/sti_drv.c
> +++ b/drivers/gpu/drm/sti/sti_drv.c
> @@ -119,30 +119,10 @@ static int sti_drm_dbg_init(struct drm_minor *minor)
>         return ret;
>  }
>
> -static int sti_atomic_check(struct drm_device *dev,
> -                           struct drm_atomic_state *state)
> -{
> -       int ret;
> -
> -       ret = drm_atomic_helper_check_modeset(dev, state);
> -       if (ret)
> -               return ret;
> -
> -       ret = drm_atomic_normalize_zpos(dev, state);
> -       if (ret)
> -               return ret;
> -
> -       ret = drm_atomic_helper_check_planes(dev, state);
> -       if (ret)
> -               return ret;
> -
> -       return ret;
> -}
> -
>  static const struct drm_mode_config_funcs sti_mode_config_funcs = {
>         .fb_create = drm_gem_fb_create,
>         .output_poll_changed = drm_fb_helper_output_poll_changed,
> -       .atomic_check = sti_atomic_check,
> +       .atomic_check = drm_atomic_helper_check,
>         .atomic_commit = drm_atomic_helper_commit,
>  };
>
> @@ -160,6 +140,8 @@ static void sti_mode_config_init(struct drm_device *dev)
>         dev->mode_config.max_height = STI_MAX_FB_HEIGHT;
>
>         dev->mode_config.funcs = &sti_mode_config_funcs;
> +
> +       dev->mode_config.normalize_zpos = true;
>  }
>
>  DEFINE_DRM_GEM_CMA_FOPS(sti_driver_fops);
> --
> Peter
>
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Peter Ujfalusi Jan. 12, 2018, 2:15 p.m. UTC | #2
Hi,

On 2018-01-12 16:07, Benjamin Gaignard wrote:
> 2018-01-12 14:21 GMT+01:00 Peter Ujfalusi <peter.ujfalusi@ti.com>:
>> Instead of re-implementing the drm_atomic_helper_check() locally with just
>> adding drm_atomic_normalize_zpos() into it, set the
>> drm_device->normalize_zpos.
>>
> 
> Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>

Thanks Benjamin!

I just noticed that I forgot to update the commit message with
s/drm_device/drm_mode_config

I will resend with updated commit message on Monday.

> 
>> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
>> CC: Benjamin Gaignard <benjamin.gaignard@linaro.org>
>> CC: Vincent Abriou <vincent.abriou@st.com>
>> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>> ---
>>  drivers/gpu/drm/sti/sti_drv.c | 24 +++---------------------
>>  1 file changed, 3 insertions(+), 21 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
>> index 55b6967d27e1..90c46b49c931 100644
>> --- a/drivers/gpu/drm/sti/sti_drv.c
>> +++ b/drivers/gpu/drm/sti/sti_drv.c
>> @@ -119,30 +119,10 @@ static int sti_drm_dbg_init(struct drm_minor *minor)
>>         return ret;
>>  }
>>
>> -static int sti_atomic_check(struct drm_device *dev,
>> -                           struct drm_atomic_state *state)
>> -{
>> -       int ret;
>> -
>> -       ret = drm_atomic_helper_check_modeset(dev, state);
>> -       if (ret)
>> -               return ret;
>> -
>> -       ret = drm_atomic_normalize_zpos(dev, state);
>> -       if (ret)
>> -               return ret;
>> -
>> -       ret = drm_atomic_helper_check_planes(dev, state);
>> -       if (ret)
>> -               return ret;
>> -
>> -       return ret;
>> -}
>> -
>>  static const struct drm_mode_config_funcs sti_mode_config_funcs = {
>>         .fb_create = drm_gem_fb_create,
>>         .output_poll_changed = drm_fb_helper_output_poll_changed,
>> -       .atomic_check = sti_atomic_check,
>> +       .atomic_check = drm_atomic_helper_check,
>>         .atomic_commit = drm_atomic_helper_commit,
>>  };
>>
>> @@ -160,6 +140,8 @@ static void sti_mode_config_init(struct drm_device *dev)
>>         dev->mode_config.max_height = STI_MAX_FB_HEIGHT;
>>
>>         dev->mode_config.funcs = &sti_mode_config_funcs;
>> +
>> +       dev->mode_config.normalize_zpos = true;
>>  }
>>
>>  DEFINE_DRM_GEM_CMA_FOPS(sti_driver_fops);
>> --
>> Peter
>>
>> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
>> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
diff mbox

Patch

diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
index 55b6967d27e1..90c46b49c931 100644
--- a/drivers/gpu/drm/sti/sti_drv.c
+++ b/drivers/gpu/drm/sti/sti_drv.c
@@ -119,30 +119,10 @@  static int sti_drm_dbg_init(struct drm_minor *minor)
 	return ret;
 }
 
-static int sti_atomic_check(struct drm_device *dev,
-			    struct drm_atomic_state *state)
-{
-	int ret;
-
-	ret = drm_atomic_helper_check_modeset(dev, state);
-	if (ret)
-		return ret;
-
-	ret = drm_atomic_normalize_zpos(dev, state);
-	if (ret)
-		return ret;
-
-	ret = drm_atomic_helper_check_planes(dev, state);
-	if (ret)
-		return ret;
-
-	return ret;
-}
-
 static const struct drm_mode_config_funcs sti_mode_config_funcs = {
 	.fb_create = drm_gem_fb_create,
 	.output_poll_changed = drm_fb_helper_output_poll_changed,
-	.atomic_check = sti_atomic_check,
+	.atomic_check = drm_atomic_helper_check,
 	.atomic_commit = drm_atomic_helper_commit,
 };
 
@@ -160,6 +140,8 @@  static void sti_mode_config_init(struct drm_device *dev)
 	dev->mode_config.max_height = STI_MAX_FB_HEIGHT;
 
 	dev->mode_config.funcs = &sti_mode_config_funcs;
+
+	dev->mode_config.normalize_zpos = true;
 }
 
 DEFINE_DRM_GEM_CMA_FOPS(sti_driver_fops);