mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: "Lowry Li (Arm Technology China)" <Lowry.Li@arm.com>
Cc: Liviu Dudau <Liviu.Dudau@arm.com>,
	"james qian wang (Arm Technology China)"
	<james.qian.wang@arm.com>,
	"maarten.lankhorst@linux.intel.com" 
	<maarten.lankhorst@linux.intel.com>,
	"seanpaul@chromium.org" <seanpaul@chromium.org>,
	"airlied@linux.ie" <airlied@linux.ie>,
	Brian Starkey <Brian.Starkey@arm.com>,
	Ayan Halder <Ayan.Halder@arm.com>,
	"Jonathan Chai (Arm Technology China)" <Jonathan.Chai@arm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"Julien Yin (Arm Technology China)" <Julien.Yin@arm.com>,
	nd <nd@arm.com>
Subject: Re: [PATCH] drm/komeda: Skips the invalid writeback job
Date: Fri, 26 Jul 2019 16:23:56 +0200	[thread overview]
Message-ID: <20190726142356.GI15868@phenom.ffwll.local> (raw)
In-Reply-To: <1564128758-23553-1-git-send-email-lowry.li@arm.com>

On Fri, Jul 26, 2019 at 08:13:00AM +0000, Lowry Li (Arm Technology China) wrote:
> Current DRM-CORE accepts the writeback_job with a empty fb, but that
> is an invalid job for HW, so need to skip it when commit it to HW.
> 
> Signed-off-by: Lowry Li (Arm Technology China) <lowry.li@arm.com>

Hm, this sounds a bit like an oversight in core writeback code? Not sure
how this can even happen, setting up a writeback job without an fb sounds
a bit like a bug to me at least ...

If we don't have a good reason for why other hw needs to accept this, then
imo this needs to be rejected in shared code. For consistent behaviour
across all writeback supporting drivers.
-Daniel

> ---
>  drivers/gpu/drm/arm/display/komeda/komeda_crtc.c         | 2 +-
>  drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c | 9 ++++++++-
>  2 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
> index 2fed1f6..372e99a 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
> @@ -265,7 +265,7 @@ void komeda_crtc_handle_event(struct komeda_crtc *kcrtc,
>  		komeda_pipeline_update(slave, old->state);
>  
>  	conn_st = wb_conn ? wb_conn->base.base.state : NULL;
> -	if (conn_st && conn_st->writeback_job)
> +	if (conn_st && conn_st->writeback_job && conn_st->writeback_job->fb)
>  		drm_writeback_queue_job(&wb_conn->base, conn_st);
>  
>  	/* step 2: notify the HW to kickoff the update */
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
> index 9787745..8e2ef63 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
> @@ -52,9 +52,16 @@
>  	struct komeda_data_flow_cfg dflow;
>  	int err;
>  
> -	if (!writeback_job || !writeback_job->fb)
> +	if (!writeback_job)
>  		return 0;
>  
> +	if (!writeback_job->fb) {
> +		if (writeback_job->out_fence)
> +			DRM_DEBUG_ATOMIC("Out fence required on a invalid writeback job.\n");
> +
> +		return writeback_job->out_fence ? -EINVAL : 0;
> +	}
> +
>  	if (!crtc_st->active) {
>  		DRM_DEBUG_ATOMIC("Cannot write the composition result out on a inactive CRTC.\n");
>  		return -EINVAL;
> -- 
> 1.9.1
> 
> _______________________________________________
> 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

  reply	other threads:[~2019-07-26 14:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-26  8:13 Lowry Li (Arm Technology China)
2019-07-26 14:23 ` Daniel Vetter [this message]
2019-07-26 14:44   ` Brian Starkey
2019-07-26 16:15     ` Daniel Vetter

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=20190726142356.GI15868@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=Ayan.Halder@arm.com \
    --cc=Brian.Starkey@arm.com \
    --cc=Jonathan.Chai@arm.com \
    --cc=Julien.Yin@arm.com \
    --cc=Liviu.Dudau@arm.com \
    --cc=Lowry.Li@arm.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=james.qian.wang@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=nd@arm.com \
    --cc=seanpaul@chromium.org \
    /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

all inboxes | Powered by JetHome®