From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Hogander, Jouni" <jouni.hogander@intel.com>
Cc: "Nikula, Jani" <jani.nikula@intel.com>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"tzimmermann@suse.de" <tzimmermann@suse.de>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/fbdev: Implement wrappers for callbacks used by fbcon
Date: Fri, 3 Feb 2023 12:42:41 +0200 [thread overview]
Message-ID: <Y9zlIV3Yt6apP8o9@intel.com> (raw)
In-Reply-To: <29978ffbbffd810a380c8d0606fffb31c8f007dd.camel@intel.com>
On Fri, Feb 03, 2023 at 07:21:27AM +0000, Hogander, Jouni wrote:
> On Tue, 2023-01-24 at 13:27 +0100, Thomas Zimmermann wrote:
> > Hi
> >
> > Am 24.01.23 um 10:10 schrieb Jouni Högander:
> > > After disconnecting damage worker from update logic our dirty
> > > callback
> > > is not called on fbcon events. This is causing problems to features
> > > (PSR, FBC, DRRS) relying on dirty callback getting called and
> > > breaking
> > > fb console when these features are in use.
> > >
> > > Implement wrappers for callbacks used by fbcon and call our dirty
> > > callback in those.
> > >
> > > Fixes: f231af498c29 ("drm/fb-helper: Disconnect damage worker from
> > > update logic")
> > > 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>
> >
> > This is the better solution wrt what fbdev wants.
>
> There was a failure from testing robot. drivers/tty/vt/vt.c is using
> spinlock and in our dirty callback we are taking mutex.
>
> Do you have any suggestions? Shall we fallback to original fix which
> was setting the dirty callback where call is made from workqueue?
Please just fix the original regression as straightforwardly as
possible.
>
> >
> > Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
> >
> > Best regards
> > Thomas
> >
> > > ---
> > > drivers/gpu/drm/i915/display/intel_fbdev.c | 53
> > > ++++++++++++++++++++--
> > > 1 file changed, 49 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c
> > > b/drivers/gpu/drm/i915/display/intel_fbdev.c
> > > index 19f3b5d92a55..b1653624552e 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
> > > @@ -77,6 +77,18 @@ static void intel_fbdev_invalidate(struct
> > > intel_fbdev *ifbdev)
> > > intel_frontbuffer_invalidate(to_frontbuffer(ifbdev),
> > > ORIGIN_CPU);
> > > }
> > >
> > > +static void intel_fbdev_dirty(struct fb_info *info)
> > > +{
> > > + struct drm_fb_helper *helper = info->par;
> > > +
> > > + /*
> > > + * Intel_fb dirty implementation doesn't use damage clips -
> > > >
> > > + * no need to pass them here
> > > + */
> > > + if (helper->fb->funcs->dirty)
> > > + helper->fb->funcs->dirty(helper->fb, NULL, 0, 0,
> > > NULL, 0);
> > > +}
> > > +
> > > static int intel_fbdev_set_par(struct fb_info *info)
> > > {
> > > struct drm_fb_helper *fb_helper = info->par;
> > > @@ -91,6 +103,39 @@ static int intel_fbdev_set_par(struct fb_info
> > > *info)
> > > return ret;
> > > }
> > >
> > > +static ssize_t intel_fbdev_write(struct fb_info *info, const char
> > > __user *buf,
> > > + size_t count, loff_t *ppos)
> > > +{
> > > + int ret;
> > > +
> > > + ret = drm_fb_helper_cfb_write(info, buf, count, ppos);
> > > + if (ret > 0)
> > > + intel_fbdev_dirty(info);
> > > +
> > > + return ret;
> > > +}
> > > +
> > > +static void intel_fbdev_fillrect(struct fb_info *info,
> > > + const struct fb_fillrect *rect)
> > > +{
> > > + drm_fb_helper_cfb_fillrect(info, rect);
> > > + intel_fbdev_dirty(info);
> > > +}
> > > +
> > > +static void intel_fbdev_copyarea(struct fb_info *info,
> > > + const struct fb_copyarea *area)
> > > +{
> > > + drm_fb_helper_cfb_copyarea(info, area);
> > > + intel_fbdev_dirty(info);
> > > +}
> > > +
> > > +static void intel_fbdev_imageblit(struct fb_info *info,
> > > + const struct fb_image *image)
> > > +{
> > > + drm_fb_helper_cfb_imageblit(info, image);
> > > + intel_fbdev_dirty(info);
> > > +}
> > > +
> > > static int intel_fbdev_blank(int blank, struct fb_info *info)
> > > {
> > > struct drm_fb_helper *fb_helper = info->par;
> > > @@ -125,10 +170,10 @@ static const struct fb_ops intelfb_ops = {
> > > DRM_FB_HELPER_DEFAULT_OPS,
> > > .fb_set_par = intel_fbdev_set_par,
> > > .fb_read = drm_fb_helper_cfb_read,
> > > - .fb_write = drm_fb_helper_cfb_write,
> > > - .fb_fillrect = drm_fb_helper_cfb_fillrect,
> > > - .fb_copyarea = drm_fb_helper_cfb_copyarea,
> > > - .fb_imageblit = drm_fb_helper_cfb_imageblit,
> > > + .fb_write = intel_fbdev_write,
> > > + .fb_fillrect = intel_fbdev_fillrect,
> > > + .fb_copyarea = intel_fbdev_copyarea,
> > > + .fb_imageblit = intel_fbdev_imageblit,
> > > .fb_pan_display = intel_fbdev_pan_display,
> > > .fb_blank = intel_fbdev_blank,
> > > };
> >
> > --
> > Thomas Zimmermann
> > Graphics Driver Developer
> > SUSE Software Solutions Germany GmbH
> > Maxfeldstr. 5, 90409 Nürnberg, Germany
> > (HRB 36809, AG Nürnberg)
> > Geschäftsführer: Ivo Totev
>
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2023-02-03 10:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-24 9:10 [Intel-gfx] [PATCH] drm/i915/fbdev: Implement wrappers for callbacks used by fbcon Jouni Högander
2023-01-24 10:13 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2023-01-24 12:16 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-01-24 12:27 ` [Intel-gfx] [PATCH] " Thomas Zimmermann
2023-02-03 7:21 ` Hogander, Jouni
2023-02-03 10:42 ` Ville Syrjälä [this message]
2023-02-03 11:09 ` Hogander, Jouni
2023-02-03 11:42 ` Thomas Zimmermann
2023-02-03 2:08 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y9zlIV3Yt6apP8o9@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=jouni.hogander@intel.com \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox