dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Marijn Suijten <marijn.suijten@somainline.org>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: freedreno@lists.freedesktop.org,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Degdag Mohamed <degdagmohamed@gmail.com>,
	Sean Paul <sean@poorly.run>,
	Bjorn Andersson <andersson@kernel.org>,
	Abhinav Kumar <quic_abhinavk@quicinc.com>,
	dri-devel@lists.freedesktop.org,
	Stephen Boyd <swboyd@chromium.org>,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH 1/2] drm/msm: provide fb_dirty implemenation
Date: Mon, 12 Jun 2023 11:14:39 +0200	[thread overview]
Message-ID: <aenzh4vscayeqvyjpbxifog7l3yuxv5lh5cizcie7dk7awx5z7@nuajlsildlw6> (raw)
In-Reply-To: <20230612031616.3620134-1-dmitry.baryshkov@linaro.org>

On 2023-06-12 06:16:15, Dmitry Baryshkov wrote:
> Since commit 93e81e38e197 ("drm/fb_helper: Minimize damage-helper
> overhead") the drm_fb_helper_funcs::fb_dirty helper is required for
> proper dirty/damage processing. The drm/msm driver requires that to
> function to let CMD panels to work. Use simplified version of
> drm_fbdev_generic_helper_fb_dirty() to fix support for CMD mode panels.
> 
> Reported-by: Degdag Mohamed <degdagmohamed@gmail.com>
> Fixes: 93e81e38e197 ("drm/fb_helper: Minimize damage-helper overhead")
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

Thanks, this solves the following warning:

    msm_dpu ae01000.display-controller: drm_WARN_ON_ONCE(!helper->funcs->fb_dirty)
    WARNING: CPU: 0 PID: 9 at drivers/gpu/drm/drm_fb_helper.c:381 drm_fb_helper_damage_work+0x1c0/0x20c

Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>

Note that drm_fb_helper_funcs documents this as "This callback is
optional": is it no longer optional, or are we enabling a damage feature
that makes it not-optional?

- Marijn

> ---
>  drivers/gpu/drm/msm/msm_fbdev.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
> index fa9c1cbffae3..b933a85420f6 100644
> --- a/drivers/gpu/drm/msm/msm_fbdev.c
> +++ b/drivers/gpu/drm/msm/msm_fbdev.c
> @@ -139,8 +139,28 @@ static int msm_fbdev_create(struct drm_fb_helper *helper,
>  	return ret;
>  }
>  
> +static int msm_fbdev_fb_dirty(struct drm_fb_helper *helper,
> +			      struct drm_clip_rect *clip)
> +{
> +	struct drm_device *dev = helper->dev;
> +	int ret;
> +
> +	/* Call damage handlers only if necessary */
> +	if (!(clip->x1 < clip->x2 && clip->y1 < clip->y2))
> +		return 0;
> +
> +	if (helper->fb->funcs->dirty) {
> +		ret = helper->fb->funcs->dirty(helper->fb, NULL, 0, 0, clip, 1);
> +		if (drm_WARN_ONCE(dev, ret, "Dirty helper failed: ret=%d\n", ret))
> +			return ret;
> +	}
> +
> +	return 0;
> +}
> +
>  static const struct drm_fb_helper_funcs msm_fb_helper_funcs = {
>  	.fb_probe = msm_fbdev_create,
> +	.fb_dirty = msm_fbdev_fb_dirty,
>  };
>  
>  /*
> -- 
> 2.39.2
> 

  parent reply	other threads:[~2023-06-12  9:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-12  3:16 [PATCH 1/2] drm/msm: provide fb_dirty implemenation Dmitry Baryshkov
2023-06-12  3:16 ` [PATCH 2/2] drm/msm/dsi: don't allow enabling 7nm VCO with unprogrammed rate Dmitry Baryshkov
2023-06-12  5:04   ` Degdag Mohamed
2023-06-12  9:15   ` Marijn Suijten
2023-06-12  9:21     ` Marijn Suijten
2023-06-12 18:30       ` Dmitry Baryshkov
2023-06-12 19:24         ` Marijn Suijten
2023-06-12  8:21 ` [PATCH 1/2] drm/msm: provide fb_dirty implemenation Thomas Zimmermann
2023-06-12 18:41   ` Dmitry Baryshkov
2023-06-12  9:14 ` Marijn Suijten [this message]
2023-06-12 10:48   ` Thomas Zimmermann
2023-06-12 18:31     ` Dmitry Baryshkov
2023-06-12 18:37   ` Marijn Suijten
2023-06-15 11:31 ` Dmitry Baryshkov

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=aenzh4vscayeqvyjpbxifog7l3yuxv5lh5cizcie7dk7awx5z7@nuajlsildlw6 \
    --to=marijn.suijten@somainline.org \
    --cc=andersson@kernel.org \
    --cc=degdagmohamed@gmail.com \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=quic_abhinavk@quicinc.com \
    --cc=sean@poorly.run \
    --cc=swboyd@chromium.org \
    --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;
as well as URLs for NNTP newsgroup(s).