* [PATCH] drm/tidss: Add prepare_fb to the plane helper funcs
@ 2020-02-27 10:13 Jyri Sarha
2020-02-27 10:31 ` Daniel Vetter
0 siblings, 1 reply; 5+ messages in thread
From: Jyri Sarha @ 2020-02-27 10:13 UTC (permalink / raw)
To: dri-devel; +Cc: peter.ujfalusi, tomi.valkeinen, laurent.pinchart, g-tammana
From: Gowtham Tammana <g-tammana@ti.com>
drm_gem_fb_prepare_fb() extracts fence and attaches to plane state.
The fence info is needed if implicit fencing is used. Add this as
prepare_fb function pointer to plane helper funcs.
Signed-off-by: Gowtham Tammana <g-tammana@ti.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
drivers/gpu/drm/tidss/tidss_plane.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/tidss/tidss_plane.c b/drivers/gpu/drm/tidss/tidss_plane.c
index ff99b2dd4a17..345678faaeb6 100644
--- a/drivers/gpu/drm/tidss/tidss_plane.c
+++ b/drivers/gpu/drm/tidss/tidss_plane.c
@@ -10,6 +10,7 @@
#include <drm/drm_crtc_helper.h>
#include <drm/drm_fourcc.h>
#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_gem_framebuffer_helper.h>
#include "tidss_crtc.h"
#include "tidss_dispc.h"
@@ -142,6 +143,7 @@ static void tidss_plane_atomic_disable(struct drm_plane *plane,
}
static const struct drm_plane_helper_funcs tidss_plane_helper_funcs = {
+ .prepare_fb = drm_gem_fb_prepare_fb,
.atomic_check = tidss_plane_atomic_check,
.atomic_update = tidss_plane_atomic_update,
.atomic_disable = tidss_plane_atomic_disable,
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/tidss: Add prepare_fb to the plane helper funcs
2020-02-27 10:13 [PATCH] drm/tidss: Add prepare_fb to the plane helper funcs Jyri Sarha
@ 2020-02-27 10:31 ` Daniel Vetter
2020-02-27 10:37 ` Daniel Vetter
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Vetter @ 2020-02-27 10:31 UTC (permalink / raw)
To: Jyri Sarha
Cc: peter.ujfalusi, tomi.valkeinen, laurent.pinchart, dri-devel, g-tammana
On Thu, Feb 27, 2020 at 12:13:07PM +0200, Jyri Sarha wrote:
> From: Gowtham Tammana <g-tammana@ti.com>
>
> drm_gem_fb_prepare_fb() extracts fence and attaches to plane state.
> The fence info is needed if implicit fencing is used. Add this as
> prepare_fb function pointer to plane helper funcs.
>
> Signed-off-by: Gowtham Tammana <g-tammana@ti.com>
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
I still wonder what we could do to catch these kind of bugs. There's
really no good reason to ever not do this as the fallback ...
Maybe time to just make this the default prepare_fb hook if neither
prepare_fb nore cleanup_fb are provided? Then roll out the removal for all
the drivers that just set this one. Otherwise we'll keep playing
whack-a-mole here forever ...
Ofc would need a bit of review and kerneldoc update, but I think that'd be
the right approach.
-Daniel
> ---
> drivers/gpu/drm/tidss/tidss_plane.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/tidss/tidss_plane.c b/drivers/gpu/drm/tidss/tidss_plane.c
> index ff99b2dd4a17..345678faaeb6 100644
> --- a/drivers/gpu/drm/tidss/tidss_plane.c
> +++ b/drivers/gpu/drm/tidss/tidss_plane.c
> @@ -10,6 +10,7 @@
> #include <drm/drm_crtc_helper.h>
> #include <drm/drm_fourcc.h>
> #include <drm/drm_fb_cma_helper.h>
> +#include <drm/drm_gem_framebuffer_helper.h>
>
> #include "tidss_crtc.h"
> #include "tidss_dispc.h"
> @@ -142,6 +143,7 @@ static void tidss_plane_atomic_disable(struct drm_plane *plane,
> }
>
> static const struct drm_plane_helper_funcs tidss_plane_helper_funcs = {
> + .prepare_fb = drm_gem_fb_prepare_fb,
> .atomic_check = tidss_plane_atomic_check,
> .atomic_update = tidss_plane_atomic_update,
> .atomic_disable = tidss_plane_atomic_disable,
> --
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/tidss: Add prepare_fb to the plane helper funcs
2020-02-27 10:31 ` Daniel Vetter
@ 2020-02-27 10:37 ` Daniel Vetter
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Vetter @ 2020-02-27 10:37 UTC (permalink / raw)
To: Jyri Sarha
Cc: peter.ujfalusi, tomi.valkeinen, laurent.pinchart, dri-devel, g-tammana
On Thu, Feb 27, 2020 at 11:31:39AM +0100, Daniel Vetter wrote:
> On Thu, Feb 27, 2020 at 12:13:07PM +0200, Jyri Sarha wrote:
> > From: Gowtham Tammana <g-tammana@ti.com>
> >
> > drm_gem_fb_prepare_fb() extracts fence and attaches to plane state.
> > The fence info is needed if implicit fencing is used. Add this as
> > prepare_fb function pointer to plane helper funcs.
> >
> > Signed-off-by: Gowtham Tammana <g-tammana@ti.com>
> > Signed-off-by: Jyri Sarha <jsarha@ti.com>
>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> I still wonder what we could do to catch these kind of bugs. There's
> really no good reason to ever not do this as the fallback ...
>
> Maybe time to just make this the default prepare_fb hook if neither
> prepare_fb nore cleanup_fb are provided? Then roll out the removal for all
> the drivers that just set this one. Otherwise we'll keep playing
> whack-a-mole here forever ...
>
> Ofc would need a bit of review and kerneldoc update, but I think that'd be
> the right approach.
Ok we'd need a notch more work here:
- Extract a version of drm_gem_fb_prepare_fb which doesn't keel over if
the gem object isn't set in the fb struct. That will take care of all
the drivers not yet converted to using these pointers, or which don't
use gem (only applies for vmwgfx).
- Add that as the default in drm_simple_kms_plane_prepare_fb and clean up
drivers using simple helpers too.
- Then long patch series to remove the default hook from all of them.
Just from a quick grep this would fix endless amounts of drivers ...
-Daniel
> -Daniel
>
> > ---
> > drivers/gpu/drm/tidss/tidss_plane.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/tidss/tidss_plane.c b/drivers/gpu/drm/tidss/tidss_plane.c
> > index ff99b2dd4a17..345678faaeb6 100644
> > --- a/drivers/gpu/drm/tidss/tidss_plane.c
> > +++ b/drivers/gpu/drm/tidss/tidss_plane.c
> > @@ -10,6 +10,7 @@
> > #include <drm/drm_crtc_helper.h>
> > #include <drm/drm_fourcc.h>
> > #include <drm/drm_fb_cma_helper.h>
> > +#include <drm/drm_gem_framebuffer_helper.h>
> >
> > #include "tidss_crtc.h"
> > #include "tidss_dispc.h"
> > @@ -142,6 +143,7 @@ static void tidss_plane_atomic_disable(struct drm_plane *plane,
> > }
> >
> > static const struct drm_plane_helper_funcs tidss_plane_helper_funcs = {
> > + .prepare_fb = drm_gem_fb_prepare_fb,
> > .atomic_check = tidss_plane_atomic_check,
> > .atomic_update = tidss_plane_atomic_update,
> > .atomic_disable = tidss_plane_atomic_disable,
> > --
> > Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] drm/tidss: Add prepare_fb to the plane helper funcs
@ 2020-08-26 13:44 Tomi Valkeinen
2020-08-26 23:27 ` Laurent Pinchart
0 siblings, 1 reply; 5+ messages in thread
From: Tomi Valkeinen @ 2020-08-26 13:44 UTC (permalink / raw)
To: dri-devel, Jyri Sarha, Laurent Pinchart; +Cc: Tomi Valkeinen, Gowtham Tammana
From: Gowtham Tammana <g-tammana@ti.com>
drm_gem_fb_prepare_fb() extracts fence and attaches to plane state.
The fence info is needed if implicit fencing is used. Add this as
prepare_fb function pointer to plane helper funcs.
Signed-off-by: Gowtham Tammana <g-tammana@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/gpu/drm/tidss/tidss_plane.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/tidss/tidss_plane.c b/drivers/gpu/drm/tidss/tidss_plane.c
index 43e72d0b2d84..35067ae674ea 100644
--- a/drivers/gpu/drm/tidss/tidss_plane.c
+++ b/drivers/gpu/drm/tidss/tidss_plane.c
@@ -10,6 +10,7 @@
#include <drm/drm_crtc_helper.h>
#include <drm/drm_fourcc.h>
#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_gem_framebuffer_helper.h>
#include "tidss_crtc.h"
#include "tidss_dispc.h"
@@ -150,6 +151,7 @@ static void drm_plane_destroy(struct drm_plane *plane)
}
static const struct drm_plane_helper_funcs tidss_plane_helper_funcs = {
+ .prepare_fb = drm_gem_fb_prepare_fb,
.atomic_check = tidss_plane_atomic_check,
.atomic_update = tidss_plane_atomic_update,
.atomic_disable = tidss_plane_atomic_disable,
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/tidss: Add prepare_fb to the plane helper funcs
2020-08-26 13:44 Tomi Valkeinen
@ 2020-08-26 23:27 ` Laurent Pinchart
0 siblings, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2020-08-26 23:27 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: Jyri Sarha, dri-devel, Gowtham Tammana
Hi Gowtham,
Thank you for the patch.
On Wed, Aug 26, 2020 at 04:44:09PM +0300, Tomi Valkeinen wrote:
> From: Gowtham Tammana <g-tammana@ti.com>
>
> drm_gem_fb_prepare_fb() extracts fence and attaches to plane state.
> The fence info is needed if implicit fencing is used. Add this as
> prepare_fb function pointer to plane helper funcs.
>
> Signed-off-by: Gowtham Tammana <g-tammana@ti.com>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/gpu/drm/tidss/tidss_plane.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/tidss/tidss_plane.c b/drivers/gpu/drm/tidss/tidss_plane.c
> index 43e72d0b2d84..35067ae674ea 100644
> --- a/drivers/gpu/drm/tidss/tidss_plane.c
> +++ b/drivers/gpu/drm/tidss/tidss_plane.c
> @@ -10,6 +10,7 @@
> #include <drm/drm_crtc_helper.h>
> #include <drm/drm_fourcc.h>
> #include <drm/drm_fb_cma_helper.h>
> +#include <drm/drm_gem_framebuffer_helper.h>
>
> #include "tidss_crtc.h"
> #include "tidss_dispc.h"
> @@ -150,6 +151,7 @@ static void drm_plane_destroy(struct drm_plane *plane)
> }
>
> static const struct drm_plane_helper_funcs tidss_plane_helper_funcs = {
> + .prepare_fb = drm_gem_fb_prepare_fb,
> .atomic_check = tidss_plane_atomic_check,
> .atomic_update = tidss_plane_atomic_update,
> .atomic_disable = tidss_plane_atomic_disable,
--
Regards,
Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-08-26 23:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-27 10:13 [PATCH] drm/tidss: Add prepare_fb to the plane helper funcs Jyri Sarha
2020-02-27 10:31 ` Daniel Vetter
2020-02-27 10:37 ` Daniel Vetter
2020-08-26 13:44 Tomi Valkeinen
2020-08-26 23:27 ` Laurent Pinchart
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).