dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/ssd130x: drop DRM_GEM_SHADOW_PLANE_FUNCS override
@ 2023-07-27 12:24 Arnd Bergmann
  2023-07-27 14:07 ` Javier Martinez Canillas
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2023-07-27 12:24 UTC (permalink / raw)
  To: Javier Martinez Canillas, David Airlie, Daniel Vetter, Maxime Ripard
  Cc: Arnd Bergmann, linux-kernel, dri-devel, Geert Uytterhoeven,
	Thomas Zimmermann, Sam Ravnborg

From: Arnd Bergmann <arnd@arndb.de>

It is not possible for ssd130x_primary_plane_funcs to use both
its own reset/duplicate/destroy callbacks and the ones from
DRM_GEM_SHADOW_PLANE_FUNCS:

In file included from drivers/gpu/drm/solomon/ssd130x.c:29:
include/drm/drm_gem_atomic_helper.h:100:18: error: initialized field overwritten [-Werror=override-init]
  100 |         .reset = drm_gem_reset_shadow_plane, \
  101 |         .atomic_duplicate_state = drm_gem_duplicate_shadow_plane_state, \
  102 |         .atomic_destroy_state = drm_gem_destroy_shadow_plane_state
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/solomon/ssd130x.c:744:9: note: in expansion of macro 'DRM_GEM_SHADOW_PLANE_FUNCS'
  744 |         DRM_GEM_SHADOW_PLANE_FUNCS,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~

Since the custom callbacks were just added, I assume these are the
ones it is meant to use, so remvoe the generic overrides.

Fixes: 45b58669e532b ("drm/ssd130x: Allocate buffer in the plane's .atomic_check() callback")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/gpu/drm/solomon/ssd130x.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c
index d2f8dd6a6347a..479de42307c88 100644
--- a/drivers/gpu/drm/solomon/ssd130x.c
+++ b/drivers/gpu/drm/solomon/ssd130x.c
@@ -741,7 +741,6 @@ static const struct drm_plane_funcs ssd130x_primary_plane_funcs = {
 	.atomic_duplicate_state = ssd130x_primary_plane_duplicate_state,
 	.atomic_destroy_state = ssd130x_primary_plane_destroy_state,
 	.destroy = drm_plane_cleanup,
-	DRM_GEM_SHADOW_PLANE_FUNCS,
 };
 
 static enum drm_mode_status ssd130x_crtc_helper_mode_valid(struct drm_crtc *crtc,
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/ssd130x: drop DRM_GEM_SHADOW_PLANE_FUNCS override
  2023-07-27 12:24 [PATCH] drm/ssd130x: drop DRM_GEM_SHADOW_PLANE_FUNCS override Arnd Bergmann
@ 2023-07-27 14:07 ` Javier Martinez Canillas
  2023-07-27 14:47   ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: Javier Martinez Canillas @ 2023-07-27 14:07 UTC (permalink / raw)
  To: Arnd Bergmann, David Airlie, Daniel Vetter, Maxime Ripard
  Cc: Arnd Bergmann, linux-kernel, dri-devel, Geert Uytterhoeven,
	Thomas Zimmermann, Sam Ravnborg

Arnd Bergmann <arnd@kernel.org> writes:

Hello Arnd,

Thanks a lot for your patch.

> From: Arnd Bergmann <arnd@arndb.de>
>
> It is not possible for ssd130x_primary_plane_funcs to use both
> its own reset/duplicate/destroy callbacks and the ones from
> DRM_GEM_SHADOW_PLANE_FUNCS:
>
> In file included from drivers/gpu/drm/solomon/ssd130x.c:29:
> include/drm/drm_gem_atomic_helper.h:100:18: error: initialized field overwritten [-Werror=override-init]
>   100 |         .reset = drm_gem_reset_shadow_plane, \
>   101 |         .atomic_duplicate_state = drm_gem_duplicate_shadow_plane_state, \
>   102 |         .atomic_destroy_state = drm_gem_destroy_shadow_plane_state
>       |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/gpu/drm/solomon/ssd130x.c:744:9: note: in expansion of macro 'DRM_GEM_SHADOW_PLANE_FUNCS'
>   744 |         DRM_GEM_SHADOW_PLANE_FUNCS,
>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
>

Gah, I missed that. I wonder how this compile warning doesn't show up for me.

> Since the custom callbacks were just added, I assume these are the
> ones it is meant to use, so remvoe the generic overrides.
>
> Fixes: 45b58669e532b ("drm/ssd130x: Allocate buffer in the plane's .atomic_check() callback")

Unfortunately that's not enough, because the plane atomic state handlers
that were introduced in that commit are broken so removing the macro will
regress the driver.

I've posted a patch that drops the macro but also fixes the handlers for
the driver to work with the custom callbacks:

https://lists.freedesktop.org/archives/dri-devel/2023-July/415897.html

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/ssd130x: drop DRM_GEM_SHADOW_PLANE_FUNCS override
  2023-07-27 14:07 ` Javier Martinez Canillas
@ 2023-07-27 14:47   ` Arnd Bergmann
  0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2023-07-27 14:47 UTC (permalink / raw)
  To: Javier Martinez Canillas, Arnd Bergmann, Dave Airlie,
	Daniel Vetter, Maxime Ripard
  Cc: Geert Uytterhoeven, Sam Ravnborg, dri-devel, Thomas Zimmermann,
	linux-kernel

On Thu, Jul 27, 2023, at 16:07, Javier Martinez Canillas wrote:
> Arnd Bergmann <arnd@kernel.org> writes:
>
> Hello Arnd,
>
> Thanks a lot for your patch.
>
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> It is not possible for ssd130x_primary_plane_funcs to use both
>> its own reset/duplicate/destroy callbacks and the ones from
>> DRM_GEM_SHADOW_PLANE_FUNCS:
>>
>> In file included from drivers/gpu/drm/solomon/ssd130x.c:29:
>> include/drm/drm_gem_atomic_helper.h:100:18: error: initialized field overwritten [-Werror=override-init]
>>   100 |         .reset = drm_gem_reset_shadow_plane, \
>>   101 |         .atomic_duplicate_state = drm_gem_duplicate_shadow_plane_state, \
>>   102 |         .atomic_destroy_state = drm_gem_destroy_shadow_plane_state
>>       |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/solomon/ssd130x.c:744:9: note: in expansion of macro 'DRM_GEM_SHADOW_PLANE_FUNCS'
>>   744 |         DRM_GEM_SHADOW_PLANE_FUNCS,
>>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>
> Gah, I missed that. I wonder how this compile warning doesn't show up for me.

The warning is normally disabled, I have it turned on in my local
patch series on top of linux-next.

>> Since the custom callbacks were just added, I assume these are the
>> ones it is meant to use, so remvoe the generic overrides.
>>
>> Fixes: 45b58669e532b ("drm/ssd130x: Allocate buffer in the plane's .atomic_check() callback")
>
> Unfortunately that's not enough, because the plane atomic state handlers
> that were introduced in that commit are broken so removing the macro will
> regress the driver.
>
> I've posted a patch that drops the macro but also fixes the handlers for
> the driver to work with the custom callbacks:
>
> https://lists.freedesktop.org/archives/dri-devel/2023-July/415897.html

Ok, makes sense.

    Arnd

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-27 14:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-27 12:24 [PATCH] drm/ssd130x: drop DRM_GEM_SHADOW_PLANE_FUNCS override Arnd Bergmann
2023-07-27 14:07 ` Javier Martinez Canillas
2023-07-27 14:47   ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).