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=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,USER_AGENT_NEOMUTT 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 51BD4C282DA for ; Wed, 17 Apr 2019 14:07:34 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 238412177B for ; Wed, 17 Apr 2019 14:07:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="PSJhaxGk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 238412177B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=V8+wVVNcWj8oiEsc/RhNi8IOJgiGh/48aAEGEIqzhzQ=; b=PSJhaxGkqZ8Mgk18tP8jnXKSR 8WhRGaIusmTO4ZsiN/QfaJsudXZ/kH/5KSq3SK+1OC8TjqfEQj7iKi5zXnxGpNBJmZknf/bc9m3BY mVt9c0WxEw9ulsd3KM/kLLn9vBx3Y5QN1vadves/fj0OE+o9O8t9vuNKIkZzdrfpMw3X60XKLw/n3 3eTJnFJuMdFKnMCUJ014PCYd6fKhhQcmLxBnn8yA0MFfKJmsRzzPq0QjYSozTvhexI2P+PKnuJF13 imAL8aPvPQ8NZEjPx4tilIpeVLgoU10RtvikZN9FMahgsiQ45aOdMxNpXpSOC2h+jqaNrXUHn8Dn/ DNuJKz0FQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGlDf-0001hq-94; Wed, 17 Apr 2019 14:07:23 +0000 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGlDW-0001U6-Qc for linux-arm-kernel@lists.infradead.org; Wed, 17 Apr 2019 14:07:20 +0000 X-Originating-IP: 90.88.160.238 Received: from localhost (aaubervilliers-681-1-42-238.w90-88.abo.wanadoo.fr [90.88.160.238]) (Authenticated sender: maxime.ripard@bootlin.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 1754DE0003; Wed, 17 Apr 2019 14:07:05 +0000 (UTC) Date: Wed, 17 Apr 2019 16:07:05 +0200 From: Maxime Ripard To: Noralf =?utf-8?Q?Tr=C3=B8nnes?= Subject: Re: [PATCH v2 4/5] drm/modes: Parse overscan properties Message-ID: <20190417140705.7rna3k6uvf7xugi3@flea> References: MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20180716 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190417_070715_498256_A623D295 X-CRM114-Status: GOOD ( 19.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: eben@raspberrypi.org, David Airlie , Maarten Lankhorst , dri-devel@lists.freedesktop.org, Paul Kocialkowski , Sean Paul , Thomas Petazzoni , Daniel Vetter , linux-arm-kernel@lists.infradead.org Content-Type: multipart/mixed; boundary="===============8418674917347201836==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============8418674917347201836== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ak5hfmrsj5rhs3jw" Content-Disposition: inline --ak5hfmrsj5rhs3jw Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Noralf, On Tue, Apr 16, 2019 at 04:52:20PM +0200, Noralf Tr=F8nnes wrote: > Den 11.04.2019 15.22, skrev Maxime Ripard: > > Properly configuring the overscan properties might be needed for the > > initial setup of the framebuffer for display that still have overscan. > > Let's allow for more properties on the kernel command line to setup each > > margin. > > > > Signed-off-by: Maxime Ripard > > --- > > drivers/gpu/drm/drm_fb_helper.c | 47 +++++++++++++++++++++++++++++++++= +- > > drivers/gpu/drm/drm_modes.c | 44 ++++++++++++++++++++++++++++++++- > > include/drm/drm_connector.h | 1 +- > > 3 files changed, 92 insertions(+) > > > > diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_h= elper.c > > index 8781897559b2..4e403fe1f451 100644 > > --- a/drivers/gpu/drm/drm_fb_helper.c > > +++ b/drivers/gpu/drm/drm_fb_helper.c > > @@ -2567,6 +2567,51 @@ static void drm_setup_crtc_rotation(struct drm_f= b_helper *fb_helper, > > fb_helper->sw_rotations |=3D DRM_MODE_ROTATE_0; > > } > > > > +static void drm_setup_connector_margins(struct drm_connector *connecto= r) > > +{ > > + struct drm_cmdline_mode *cmdline =3D &connector->cmdline_mode; > > + struct drm_modeset_acquire_ctx ctx; > > + struct drm_atomic_state *state; > > + struct drm_device *dev =3D connector->dev; > > + int ret; > > + > > + if (!drm_drv_uses_atomic_modeset(dev)) > > + return; > > + > > + drm_modeset_acquire_init(&ctx, 0); > > + > > + state =3D drm_atomic_state_alloc(dev); > > + state->acquire_ctx =3D &ctx; > > + > > +retry: > > + drm_atomic_set_property(state, &connector->base, > > + dev->mode_config.tv_left_margin_property, > > + cmdline->overscan_left); > > + > > + drm_atomic_set_property(state, &connector->base, > > + dev->mode_config.tv_right_margin_property, > > + cmdline->overscan_right); > > + > > + drm_atomic_set_property(state, &connector->base, > > + dev->mode_config.tv_top_margin_property, > > + cmdline->overscan_top); > > + > > + drm_atomic_set_property(state, &connector->base, > > + dev->mode_config.tv_bottom_margin_property, > > + cmdline->overscan_bottom); > > + > > + ret =3D drm_atomic_commit(state); > > + if (ret =3D=3D -EDEADLK) { > > + drm_atomic_state_clear(state); > > + drm_modeset_backoff(&ctx); > > + goto retry; > > + } > > + > > + drm_atomic_state_put(state); > > + drm_modeset_drop_locks(&ctx); > > + drm_modeset_acquire_fini(&ctx); > > +} > > + > > Should we set these property values in drm_connector_init()? > I assume that DRM userspace would want to use these values as well. I'm not sure, I've looked into it, and most drivers will create those properties and attached *after* running drm_connector_init. If you're using drm_mode_create_tv_margin_properties, then the first thing it does is to check whether that property has been created already, so we're covered. For drm_connector_attach_tv_margins_properties though, this will force overwrite the value. One thing I'm not really fond of either is that you would do this even if the driver cannot support the margins at all. Maybe we can put this into drm_connector_attach_tv_margins_properties? Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --ak5hfmrsj5rhs3jw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXLczCQAKCRDj7w1vZxhR xZIxAQDbh5kLIDL5LrN96YhVyCa2QJgZzyrUsuTOQMuGs3s9GQEAxVuIR6twtLOa FI2qK3dwWd0lS7QEeyR692m72xSh3ws= =0HZq -----END PGP SIGNATURE----- --ak5hfmrsj5rhs3jw-- --===============8418674917347201836== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============8418674917347201836==--