linux-kernel.vger.kernel.org archive mirror
 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 v2 2/2] drm/komeda: Adds komeda_kms_drop_master
Date: Tue, 11 Jun 2019 14:30:38 +0200	[thread overview]
Message-ID: <20190611123038.GC2458@phenom.ffwll.local> (raw)
In-Reply-To: <1560251589-31827-3-git-send-email-lowry.li@arm.com>

On Tue, Jun 11, 2019 at 11:13:45AM +0000, Lowry Li (Arm Technology China) wrote:
> From: "Lowry Li (Arm Technology China)" <Lowry.Li@arm.com>
> 
> The komeda internal resources (pipelines) are shared between crtcs,
> and resources release by disable_crtc. This commit is working for once
> user forgot disabling crtc like app quit abnomally, and then the
> resources can not be used by another crtc. Adds drop_master to
> shutdown the device and make sure all the komeda resources have been
> released and can be used for the next usage.
> 
> Signed-off-by: Lowry Li (Arm Technology China) <lowry.li@arm.com>
> ---
>  drivers/gpu/drm/arm/display/komeda/komeda_kms.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
> index 8543860..647bce5 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
> @@ -54,11 +54,24 @@ static irqreturn_t komeda_kms_irq_handler(int irq, void *data)
>  	return status;
>  }
>  
> +/* Komeda internal resources (pipelines) are shared between crtcs, and resources
> + * are released by disable_crtc. But if user forget disabling crtc like app quit
> + * abnormally, the resources can not be used by another crtc.
> + * Use drop_master to shutdown the device and make sure all the komeda resources
> + * have been released, and can be used for the next usage.
> + */

No. If we want this, we need to implement this across drivers, not with
per-vendor hacks.

The kerneldoc should have been a solid hint: "Only used by vmwgfx."
-Daniel

> +static void komeda_kms_drop_master(struct drm_device *dev,
> +				   struct drm_file *file_priv)
> +{
> +	drm_atomic_helper_shutdown(dev);
> +}
> +
>  static struct drm_driver komeda_kms_driver = {
>  	.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC |
>  			   DRIVER_PRIME | DRIVER_HAVE_IRQ,
>  	.lastclose			= drm_fb_helper_lastclose,
>  	.irq_handler			= komeda_kms_irq_handler,
> +	.master_drop			= komeda_kms_drop_master,
>  	.gem_free_object_unlocked	= drm_gem_cma_free_object,
>  	.gem_vm_ops			= &drm_gem_cma_vm_ops,
>  	.dumb_create			= komeda_gem_cma_dumb_create,
> -- 
> 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-06-11 12:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-11 11:13 [PATCH v2 0/2] Adds slave pipeline support Lowry Li (Arm Technology China)
2019-06-11 11:13 ` [PATCH v2 1/2] drm/komeda: Add " Lowry Li (Arm Technology China)
2019-06-12 10:51   ` [v2,1/2] " james qian wang (Arm Technology China)
2019-06-11 11:13 ` [PATCH v2 2/2] drm/komeda: Adds komeda_kms_drop_master Lowry Li (Arm Technology China)
2019-06-11 12:30   ` Daniel Vetter [this message]
2019-06-12  2:26     ` james qian wang (Arm Technology China)
2019-06-13  8:17       ` Daniel Vetter
2019-06-13  8:28         ` Liviu Dudau
2019-06-13  9:08           ` Daniel Vetter
2019-06-13 13:24             ` Liviu Dudau
2019-06-13 14:30               ` Daniel Vetter
2019-06-14  5:46                 ` james qian wang (Arm Technology China)
2019-06-14  7:01                   ` Daniel Vetter
2019-06-14  8:53                     ` james qian wang (Arm Technology China)

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=20190611123038.GC2458@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;
as well as URLs for NNTP newsgroup(s).