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=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 4264DC35250 for ; Fri, 7 Feb 2020 16:36:20 +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 138A9217BA for ; Fri, 7 Feb 2020 16:36:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="I91Ao0MC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 138A9217BA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 872CC6E0B8; Fri, 7 Feb 2020 16:36:19 +0000 (UTC) Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by gabe.freedesktop.org (Postfix) with ESMTPS id 880A46E0AF for ; Fri, 7 Feb 2020 16:36:17 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id t23so3233522wmi.1 for ; Fri, 07 Feb 2020 08:36:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=Xr0r1NPoghHw+wX1zbKLRQxBTFmc0m0oEomBjFuzToM=; b=I91Ao0MC/+Sfr+pi31770W3toz4FNxpwk1Bb5idAfibYLLF7nQ+gZjYQXHnK3UsU4r HIcdWvBDHlXCSEBtBhJbhFewn0ScqFyeCN8st1LUgNr41HEBX4VctJjBO6HIWlZpZ6GF aqghDIG/hNudginaf3QJCanL7pDqGLC4SbcGQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=Xr0r1NPoghHw+wX1zbKLRQxBTFmc0m0oEomBjFuzToM=; b=haU3Q5tPmnY112i+cCQloQg/Ispu305VveH49hUsgky4MWPBdAvBgiGwGMHRjiT1pc vJ/3ZD5hWyrOKyyvxD7fcz11yhQRkCGV1DmMzCU8SXTvVy9YF5ohYVMVchq63S9dDoMv i1MFO0M3JRiiC0wGD5is9WWdjSbka9U6MoSv5NPRKI8x3r6FPwaQS9CaGg13eTnvg6/d SS3u//MehYafAPPfXedxVzql3EXtp0OnMI+MOaSqAgBmLcRhwl+1wyytsDSOdGHkjJ2D 1cqR95XxdMe+jm1jAo9WyHY93XtEuBAR80ayeKxiXbokb073T3Ou0eVnLSeiix13NU2D xVeQ== X-Gm-Message-State: APjAAAX9RPNzrUMENXbinPYKJJlZqf1S2oJRSpiUUMXzwcdx7MTknYWa iMImJn2NAjHAopLBkVAvavmFxg== X-Google-Smtp-Source: APXvYqzA/+lmNPvP32/zA1Dqh6EJejEjOBvyyisRjfr+1ATQ0Qj/UrFORq5VwDruZ4QHXVIx1BWUAw== X-Received: by 2002:a05:600c:2383:: with SMTP id m3mr5346187wma.32.1581093376217; Fri, 07 Feb 2020 08:36:16 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id g21sm3840013wmh.17.2020.02.07.08.36.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 08:36:15 -0800 (PST) Date: Fri, 7 Feb 2020 17:36:13 +0100 From: Daniel Vetter To: Ville Syrjala Subject: Re: [PATCH v2 1/6] drm: Include the encoder itself in possible_clones Message-ID: <20200207163613.GM43062@phenom.ffwll.local> 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: <20200207135950.6655-2-ville.syrjala@linux.intel.com> X-Operating-System: Linux phenom 5.3.0-3-amd64 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org, Thomas Zimmermann , dri-devel@lists.freedesktop.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, Feb 07, 2020 at 03:59:45PM +0200, Ville Syrjala wrote: > 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 > --- > 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_encoder.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_en= um_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); This is way too late, we've already registered the chardev minors at this point. I think we need a new drm_mode_config_validate() at the top of drm_dev_register, but which does _not_ run when the driver has a ->load callback (which soon will be no driver at all). Cheers, Daniel > + > drm_for_each_encoder(encoder, dev) { > if (encoder->funcs->late_register) > ret =3D encoder->funcs->late_register(encoder); > -- = > 2.24.1 > = -- = Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel 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=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 72FC3C2BA83 for ; Fri, 7 Feb 2020 16:36:19 +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 45C48217BA for ; Fri, 7 Feb 2020 16:36:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="I91Ao0MC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 45C48217BA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch 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 EA49C6E094; Fri, 7 Feb 2020 16:36:18 +0000 (UTC) Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id 847F76E094 for ; Fri, 7 Feb 2020 16:36:17 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id f129so3484513wmf.2 for ; Fri, 07 Feb 2020 08:36:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=Xr0r1NPoghHw+wX1zbKLRQxBTFmc0m0oEomBjFuzToM=; b=I91Ao0MC/+Sfr+pi31770W3toz4FNxpwk1Bb5idAfibYLLF7nQ+gZjYQXHnK3UsU4r HIcdWvBDHlXCSEBtBhJbhFewn0ScqFyeCN8st1LUgNr41HEBX4VctJjBO6HIWlZpZ6GF aqghDIG/hNudginaf3QJCanL7pDqGLC4SbcGQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=Xr0r1NPoghHw+wX1zbKLRQxBTFmc0m0oEomBjFuzToM=; b=LmgmyxGjcbtGElZp85uf+AkbcGD0CEhivKZixsF8KphZb3JvpwQsh+ZQ1DJKQGADKt UKFByNqBIAyYjbK2oVRNzlD0Nm2B8AMoRfc3CqAXu9gC4gm4umx4IqDybe1v3tdj51eS Q/MuFOuPcERbuCGMR/t7PPhMr0Z01FGPL4usYCQKZ9hhG60KmwT3PPUfAfxD0w8GE+Eq M1knR244Pl6ePLIrD+rkPMg/xdkqWJkVcoTKRYh6SKF9spe0LmYMThnNWS7V5DZFgag9 /2q/+skSFoqVsMz1mSmjn9Tgas88l6UnSguClKWxf5IratLOvCinhmzHYsYb0qq64TjZ BehA== X-Gm-Message-State: APjAAAW8WyeG8Wh033UpP67AX4fCpQ81fM9T1hDbO8ILD8BwPM35cku6 0gEIY/uL6K4fKJdXDy/RAb/m1w== X-Google-Smtp-Source: APXvYqzA/+lmNPvP32/zA1Dqh6EJejEjOBvyyisRjfr+1ATQ0Qj/UrFORq5VwDruZ4QHXVIx1BWUAw== X-Received: by 2002:a05:600c:2383:: with SMTP id m3mr5346187wma.32.1581093376217; Fri, 07 Feb 2020 08:36:16 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id g21sm3840013wmh.17.2020.02.07.08.36.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 08:36:15 -0800 (PST) Date: Fri, 7 Feb 2020 17:36:13 +0100 From: Daniel Vetter To: Ville Syrjala Message-ID: <20200207163613.GM43062@phenom.ffwll.local> 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: <20200207135950.6655-2-ville.syrjala@linux.intel.com> X-Operating-System: Linux phenom 5.3.0-3-amd64 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, Thomas Zimmermann , 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:59:45PM +0200, Ville Syrjala wrote: > 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 > --- > 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_encoder.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_en= um_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); This is way too late, we've already registered the chardev minors at this point. I think we need a new drm_mode_config_validate() at the top of drm_dev_register, but which does _not_ run when the driver has a ->load callback (which soon will be no driver at all). Cheers, Daniel > + > drm_for_each_encoder(encoder, dev) { > if (encoder->funcs->late_register) > ret =3D encoder->funcs->late_register(encoder); > -- = > 2.24.1 > = -- = Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx