From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D309AC04EB5 for ; Fri, 7 Feb 2020 14:50:06 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A374420720 for ; Fri, 7 Feb 2020 14:50:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A374420720 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 38AF26FCE0; Fri, 7 Feb 2020 14:50:06 +0000 (UTC) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 37B466FCE0; Fri, 7 Feb 2020 14:50:05 +0000 (UTC) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Feb 2020 06:50:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,413,1574150400"; d="scan'208";a="220816121" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga007.jf.intel.com with SMTP; 07 Feb 2020 06:50:02 -0800 Received: by stinkbox (sSMTP sendmail emulation); Fri, 07 Feb 2020 16:50:01 +0200 Date: Fri, 7 Feb 2020 16:50:01 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Thomas Zimmermann Message-ID: <20200207145001.GI13686@intel.com> References: <20200207135950.6655-1-ville.syrjala@linux.intel.com> <20200207135950.6655-2-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Patchwork-Hint: comment User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [Intel-gfx] [PATCH v2 1/6] drm: Include the encoder itself in possible_clones X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Fri, Feb 07, 2020 at 03:28:35PM +0100, Thomas Zimmermann wrote: > Hi > = > Am 07.02.20 um 14:59 schrieb Ville Syrjala: > > From: Ville Syrj=E4l=E4 > > = > > The docs say possible_clones should always include the encoder itself. > > Since most drivers don't want to deal with the complexities of cloning > > let's allow them to set possible_clones=3D0 and instead we'll fix that > > up in the core. > > = > > We can't put this special case into drm_encoder_init() because drivers > > will have to fill up possible_clones after adding all the relevant > > encoders. Otherwise they wouldn't know the proper encoder indexes to > > use. So we'll just do it just before registering the encoders. > > = > > TODO: Should we do something similar for possible_crtcs=3D=3D0? > > = > > Cc: Thomas Zimmermann > > Cc: Daniel Vetter > > Signed-off-by: Ville Syrj=E4l=E4 > = > May this fixup function should warn iff possible_clones was set to non-0 > by the driver, but the encoder itself is missing. Yeah, I guess we could do that. > In any case > = > Acked-by: Thomas Zimmermann > = > > --- > > drivers/gpu/drm/drm_encoder.c | 15 +++++++++++++++ > > 1 file changed, 15 insertions(+) > > = > > diff --git a/drivers/gpu/drm/drm_encoder.c b/drivers/gpu/drm/drm_encode= r.c > > index e555281f43d4..f761d9306028 100644 > > --- a/drivers/gpu/drm/drm_encoder.c > > +++ b/drivers/gpu/drm/drm_encoder.c > > @@ -66,11 +66,26 @@ static const struct drm_prop_enum_list drm_encoder_= enum_list[] =3D { > > { DRM_MODE_ENCODER_DPI, "DPI" }, > > }; > > = > > +/* > > + * For some reason we want the encoder itself included in > > + * possible_clones. Make life easy for drivers by allowing them > > + * to leave possible_clones unset if no cloning is possible. > > + */ > > +static void fixup_possible_clones(struct drm_device *dev) > > +{ > > + struct drm_encoder *encoder; > > + > > + drm_for_each_encoder(encoder, dev) > > + encoder->possible_clones |=3D drm_encoder_mask(encoder); > > +} > > + > > int drm_encoder_register_all(struct drm_device *dev) > > { > > struct drm_encoder *encoder; > > int ret =3D 0; > > = > > + fixup_possible_clones(dev); > > + > > drm_for_each_encoder(encoder, dev) { > > if (encoder->funcs->late_register) > > ret =3D encoder->funcs->late_register(encoder); > > = > = > -- = > Thomas Zimmermann > Graphics Driver Developer > SUSE Software Solutions Germany GmbH > Maxfeldstr. 5, 90409 N=FCrnberg, Germany > (HRB 36809, AG N=FCrnberg) > Gesch=E4ftsf=FChrer: Felix Imend=F6rffer > = -- = Ville Syrj=E4l=E4 Intel _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx