Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7099847ybi; Thu, 13 Jun 2019 09:32:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqxm+InSpscSvlf3z4dPD8KFZlyPgDOB74FbhhW4MB0hD/lXxspbDiEQ+uv71wHv3joR/V1k X-Received: by 2002:a17:90a:658b:: with SMTP id k11mr6562755pjj.44.1560443554521; Thu, 13 Jun 2019 09:32:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560443554; cv=none; d=google.com; s=arc-20160816; b=gRUJz/0Xp/I/4iULwSAp2ciXsnomArkKPgXbgxtlApbntR+e0xRERcztc22SbmThMq wwEbocEixg4Ux6pDKGKkEAB+dwDKzflGvdB9PHYLuJIlq+57A5CEgGqIMFCTBSalsRrf 4+DI48cZ16Ti4NfSX9g+3GDFxktOoF1CLiQPuRdfE/aEjFLXpXZ2U3z9HcdpfbY0YKDI LKfSMV3YVBvb2DPbXiq6pgS0tbB+DJE5JNDMj5Etq951J+ulE17FhlMTWiL/s2aBwMLn ZBsQ2YUSo48jZogp5T2cFYFcy2YDnDfm+/mFf4BILSGzQU/KFvAolUiR9LzCATx9LRRd KPbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=BQUUVEbQBU82PrsMmM0DVRQxiyyQyaOoAc/ZkL7aGuo=; b=dU2SU5J+FIOjmCOzQ7qwp2/OjC6DiBnaB1rGvKUOETHFJva+JYNb2/trBduQbM/NQ+ oXY9Ov5Vo/z7DPS7ihQJucJ1ZyAARdiXy15huKz0VrFuVTsfUnxKTRDm3qF1RLPPDr/l IlBY7trdw/Fui8xCC/68jZzyaFSIc71UeIu/kSSPVF2I5ZasFu3O93fFTg1M+Tyl08+L f3nI09Tehn0TH05vqtdX4WhqimJzihHIJ2WySyQkaqiixre2NoQ8mBcx9Cl6THjsl82R vV+Xqta8zPFcOL4IkcVbCOWikkbIP6U9MmKBObwGJVfmWVf5erS15ykFyljL+pNoF9yh l1yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=X+b6N9AQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a32si110860pje.7.2019.06.13.09.32.19; Thu, 13 Jun 2019 09:32:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=X+b6N9AQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388664AbfFMQcQ (ORCPT + 99 others); Thu, 13 Jun 2019 12:32:16 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:33527 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730853AbfFMIRd (ORCPT ); Thu, 13 Jun 2019 04:17:33 -0400 Received: by mail-ed1-f66.google.com with SMTP id i11so1947456edq.0 for ; Thu, 13 Jun 2019 01:17:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=BQUUVEbQBU82PrsMmM0DVRQxiyyQyaOoAc/ZkL7aGuo=; b=X+b6N9AQTQnv51mbGk3cs5WE9bgrZHoAhFo/kUpYWZ5C1X+XPaJBiRSZKXyXhgfLAB FquWhUU5SR0q1mI/n9p3wd5IYCOydO54EL5R4arx/NUINxsBTIzuZTrrx5APCrgoL6ng 2M72ZA4ZKI9vl4v+mSrRECRt2QmkMtBH1G6Kk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=BQUUVEbQBU82PrsMmM0DVRQxiyyQyaOoAc/ZkL7aGuo=; b=W5roHRgDMLEtNy77BYFKjbQhpLaTqaJORUTgAeEwTcIP/V7JwydrbdP62W7WJuwroX +zL6PK+KB6gOa8YfYy961w4fIpFx1tU9rSZVleCs3/O3D9KgPUhnpsCwPq2AzPoNluz1 BZ2fpAHIpRqB0eTecGiSv2OHWP5OToK6ScArj29rO0q6p+0jKelgJ7tWqC2XOVkKprLy +Phi93nGCrwPK8Chx9zy0joBxgJDbgHR0xLlNAa6aqhWriOOy9F9Ov9bZVZRj835vixE D5kNTWIksTwWCGifdTeWP255Ri8tTzBPWsck/hP5kxkdRCrLtJaci9fEiqj03y7ClaWZ GxkA== X-Gm-Message-State: APjAAAU4RxCm/CS6H/+VYNp6uKIn2FdB29fEpENLdp/7169dsWEYfx8E yqRubEuNthkDlfb/jscbXu3l3g== X-Received: by 2002:a17:906:610:: with SMTP id s16mr74446842ejb.108.1560413851058; Thu, 13 Jun 2019 01:17:31 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id t54sm681937edd.17.2019.06.13.01.17.29 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 13 Jun 2019 01:17:30 -0700 (PDT) Date: Thu, 13 Jun 2019 10:17:27 +0200 From: Daniel Vetter To: "james qian wang (Arm Technology China)" Cc: "Lowry Li (Arm Technology China)" , Liviu Dudau , "maarten.lankhorst@linux.intel.com" , "seanpaul@chromium.org" , "airlied@linux.ie" , Brian Starkey , Ayan Halder , "Jonathan Chai (Arm Technology China)" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "Julien Yin (Arm Technology China)" , nd Subject: Re: [PATCH v2 2/2] drm/komeda: Adds komeda_kms_drop_master Message-ID: <20190613081727.GE23020@phenom.ffwll.local> Mail-Followup-To: "james qian wang (Arm Technology China)" , "Lowry Li (Arm Technology China)" , Liviu Dudau , "maarten.lankhorst@linux.intel.com" , "seanpaul@chromium.org" , "airlied@linux.ie" , Brian Starkey , Ayan Halder , "Jonathan Chai (Arm Technology China)" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "Julien Yin (Arm Technology China)" , nd References: <1560251589-31827-1-git-send-email-lowry.li@arm.com> <1560251589-31827-3-git-send-email-lowry.li@arm.com> <20190611123038.GC2458@phenom.ffwll.local> <20190612022617.GA8595@james-ThinkStation-P300> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190612022617.GA8595@james-ThinkStation-P300> X-Operating-System: Linux phenom 4.19.0-5-amd64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 12, 2019 at 02:26:24AM +0000, james qian wang (Arm Technology China) wrote: > On Tue, Jun 11, 2019 at 02:30:38PM +0200, Daniel Vetter wrote: > > On Tue, Jun 11, 2019 at 11:13:45AM +0000, Lowry Li (Arm Technology China) wrote: > > > From: "Lowry Li (Arm Technology China)" > > > > > > 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) > > > --- > > > 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 > > Hi Daniel: > This drop_master is really what we want, can we update the doc and > add komeda as a user of this hacks like "used by vmwfgx and komeda", > or maybe directly promote this per-vendor hacks as an optional chip > function ? Still no, because it would mean different behaviour for arm/komeda compared to everyone else. And we really don't want this, because this would completely break flicker-less vt-switching. Currently the only fallback for this case is the lastclose handler, which atm just restores fbcon/fbdev. If you want to change/extend that to work without fbdev, then that's the place to do the change. And across _all_ drm kms drivers, so that we have consistent behaviour. kms is a cross-vendor api, vendor hacks are very, very much not cool. -Daniel > > James > > > > +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 > IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. > _______________________________________________ > 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