diff mbox series

[v3] drm/i915/fbdev: Implement fb_dirty for intel custom fb helper

Message ID 20221221153816.1915426-1-jouni.hogander@intel.com (mailing list archive)
State New, archived
Headers show
Series [v3] drm/i915/fbdev: Implement fb_dirty for intel custom fb helper | expand

Commit Message

Hogander, Jouni Dec. 21, 2022, 3:38 p.m. UTC
After splitting generic drm_fb_helper into it's own file it's left to
helper implementation to have fb_dirty function. Currently intel
fbdev doesn't have it. This is causing problems to features (PSR, FBC,
DRRS) relying on dirty callback.

Implement simple fb_dirty callback to deliver notifications about updates
in fb console.

v3: Check damage clip
v2: Improved commit message and added Fixes tag

Fixes: 8ab59da26bc0 ("drm/fb-helper: Move generic fbdev emulation into separate source file")
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
---
 drivers/gpu/drm/i915/display/intel_fbdev.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Ville Syrjälä Jan. 20, 2023, 5:30 p.m. UTC | #1
On Wed, Dec 21, 2022 at 05:38:16PM +0200, Jouni Högander wrote:
> After splitting generic drm_fb_helper into it's own file it's left to
> helper implementation to have fb_dirty function. Currently intel
> fbdev doesn't have it. This is causing problems to features (PSR, FBC,
> DRRS) relying on dirty callback.
> 
> Implement simple fb_dirty callback to deliver notifications about updates
> in fb console.
> 
> v3: Check damage clip
> v2: Improved commit message and added Fixes tag
> 
> Fixes: 8ab59da26bc0 ("drm/fb-helper: Move generic fbdev emulation into separate source file")

That doesn't look like a funcitonal change to me.
Was it really that commit that broke things?

> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_fbdev.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
> index 03ed4607a46d..4e87d9964fcc 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
> @@ -328,8 +328,20 @@ static int intelfb_create(struct drm_fb_helper *helper,
>  	return ret;
>  }
>  
> +static int intelfb_dirty(struct drm_fb_helper *helper, struct drm_clip_rect *clip)
> +{
> +	if (!(clip->x1 < clip->x2 && clip->y1 < clip->y2))
> +		return 0;
> +
> +	if (helper->fb->funcs->dirty)
> +		return helper->fb->funcs->dirty(helper->fb, NULL, 0, 0, clip, 1);
> +
> +	return 0;
> +}
> +
>  static const struct drm_fb_helper_funcs intel_fb_helper_funcs = {
>  	.fb_probe = intelfb_create,
> +	.fb_dirty = intelfb_dirty,
>  };
>  
>  static void intel_fbdev_destroy(struct intel_fbdev *ifbdev)
> -- 
> 2.34.1
Hogander, Jouni Jan. 23, 2023, 7:45 a.m. UTC | #2
On Fri, 2023-01-20 at 19:30 +0200, Ville Syrjälä wrote:
> On Wed, Dec 21, 2022 at 05:38:16PM +0200, Jouni Högander wrote:
> > After splitting generic drm_fb_helper into it's own file it's left
> > to
> > helper implementation to have fb_dirty function. Currently intel
> > fbdev doesn't have it. This is causing problems to features (PSR,
> > FBC,
> > DRRS) relying on dirty callback.
> > 
> > Implement simple fb_dirty callback to deliver notifications about
> > updates
> > in fb console.
> > 
> > v3: Check damage clip
> > v2: Improved commit message and added Fixes tag
> > 
> > Fixes: 8ab59da26bc0 ("drm/fb-helper: Move generic fbdev emulation
> > into separate source file")
> 
> That doesn't look like a funcitonal change to me.
> Was it really that commit that broke things?

You are right. It seems I originally bisected wrong patch from the set.
Fixed now in version 4. Please check.

> 
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Cc: Thomas Zimmermann <tzimmermann@suse.de>
> > Cc: Jani Nikula <jani.nikula@intel.com>
> > Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_fbdev.c | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c
> > b/drivers/gpu/drm/i915/display/intel_fbdev.c
> > index 03ed4607a46d..4e87d9964fcc 100644
> > --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
> > +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
> > @@ -328,8 +328,20 @@ static int intelfb_create(struct drm_fb_helper
> > *helper,
> >         return ret;
> >  }
> >  
> > +static int intelfb_dirty(struct drm_fb_helper *helper, struct
> > drm_clip_rect *clip)
> > +{
> > +       if (!(clip->x1 < clip->x2 && clip->y1 < clip->y2))
> > +               return 0;
> > +
> > +       if (helper->fb->funcs->dirty)
> > +               return helper->fb->funcs->dirty(helper->fb, NULL,
> > 0, 0, clip, 1);
> > + Disconnect damage worker from update logic
> > +       return 0;
> > +}
> > +
> >  static const struct drm_fb_helper_funcs intel_fb_helper_funcs = {
> >         .fb_probe = intelfb_create,
> > +       .fb_dirty = intelfb_dirty,
> >  };
> >  
> >  static void intel_fbdev_destroy(struct intel_fbdev *ifbdev)
> > -- 
> > 2.34.1
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
index 03ed4607a46d..4e87d9964fcc 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
@@ -328,8 +328,20 @@  static int intelfb_create(struct drm_fb_helper *helper,
 	return ret;
 }
 
+static int intelfb_dirty(struct drm_fb_helper *helper, struct drm_clip_rect *clip)
+{
+	if (!(clip->x1 < clip->x2 && clip->y1 < clip->y2))
+		return 0;
+
+	if (helper->fb->funcs->dirty)
+		return helper->fb->funcs->dirty(helper->fb, NULL, 0, 0, clip, 1);
+
+	return 0;
+}
+
 static const struct drm_fb_helper_funcs intel_fb_helper_funcs = {
 	.fb_probe = intelfb_create,
+	.fb_dirty = intelfb_dirty,
 };
 
 static void intel_fbdev_destroy(struct intel_fbdev *ifbdev)