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=-3.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 AED59C2D0C3 for ; Mon, 16 Dec 2019 18:08:17 +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 1B91A2072B for ; Mon, 16 Dec 2019 18:08:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gerhold.net header.i=@gerhold.net header.b="og22PhcP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B91A2072B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gerhold.net 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 89B8A6E859; Mon, 16 Dec 2019 18:08:16 +0000 (UTC) Received: from mo6-p01-ob.smtp.rzone.de (mo6-p01-ob.smtp.rzone.de [IPv6:2a01:238:20a:202:5301::11]) by gabe.freedesktop.org (Postfix) with ESMTPS id A66996E859 for ; Mon, 16 Dec 2019 18:08:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1576519693; s=strato-dkim-0002; d=gerhold.net; h=In-Reply-To:References:Message-ID:Subject:Cc:To:From:Date: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=XCikyp4VezyyxNWDJKpyShwztCEMh0HWrjRy3JevmDE=; b=og22PhcPEREzpb2x+U+kYjkTXogT7ycoZbq3rOyRsVtGmUg5qymKG1HqapJY2kn2pN rRURjmfe/kxfh834LnEQYaKcUeoipjpzDnsNDoWm/EYzmZ1r6FKEedWasRZ4GB+P5ufT lGXi2XV6pAuDaqlenyOuX/dhGQBU4XVah3QCkSDaVCpdTd1YxL49JThpWB+0mvKBgZTt y/gVIZY1YTINMHjYvVWjLAMYw945EcwZY0bJRVmnaoEg1WGx0dYhzQhcBnlFz6V7p72W Fq/TXJz3EBJdotUQCPyeqXJkLFS4/lh5qY6+3NEFb61Wxy0YnIKNGY4OwMiZH4uBClDJ bxkw== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVOQ/OcYgojyw4j34+u266EZF6ORJDdfbYtbb1Kg==" X-RZG-CLASS-ID: mo00 Received: from gerhold.net by smtp.strato.de (RZmta 46.0.7 AUTH) with ESMTPSA id N0b206vBGI8CP7A (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Mon, 16 Dec 2019 19:08:12 +0100 (CET) Date: Mon, 16 Dec 2019 19:08:11 +0100 From: Stephan Gerhold To: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH v2] drm/modes: Apply video parameters with only reflect option Message-ID: <20191216180811.GB173588@gerhold.net> References: <20191216171017.173326-1-stephan@gerhold.net> <20191216172725.GZ1208@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191216172725.GZ1208@intel.com> 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: David Airlie , 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 Mon, Dec 16, 2019 at 07:27:25PM +0200, Ville Syrj=E4l=E4 wrote: > On Mon, Dec 16, 2019 at 06:10:17PM +0100, Stephan Gerhold wrote: > > At the moment, video mode parameters like video=3D540x960,reflect_x, > > (without rotation set) are not taken into account when applying the > > mode in drm_client_modeset.c. > = > A rotation value without exactly one rotation angle is illegal. > IMO the code should not generate a value like that in the first > place. > = You're right. I was thinking about this when creating this patch. But then I was not sure if "mode->rotation_reflection" is supposed to be a valid rotation value.The zero value is currently used to check if any rotation/reflection was specified at all: [...] > > diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm= _client_modeset.c > > index 895b73f23079..cfebce4f19a5 100644 > > --- a/drivers/gpu/drm/drm_client_modeset.c > > +++ b/drivers/gpu/drm/drm_client_modeset.c > > @@ -859,19 +859,23 @@ bool drm_client_rotation(struct drm_mode_set *mod= eset, unsigned int *rotation) > > */ > > cmdline =3D &connector->cmdline_mode; > > if (cmdline->specified && cmdline->rotation_reflection) { I can try to make your suggested change in the cmdline parsing code, but since this sounds like a larger change I would appreciate some other opinions first. Thanks, Stephan > > = > > - unsigned int cmdline_rest, panel_rest; > > - unsigned int cmdline_rot, panel_rot; > > - unsigned int sum_rot, sum_rest; > > + if (cmdline->rotation_reflection & DRM_MODE_ROTATE_MASK) { > > + unsigned int cmdline_rest, panel_rest; > > + unsigned int cmdline_rot, panel_rot; > > + unsigned int sum_rot, sum_rest; > > = > > - panel_rot =3D ilog2(*rotation & DRM_MODE_ROTATE_MASK); > > - cmdline_rot =3D ilog2(cmdline->rotation_reflection & DRM_MODE_ROTATE= _MASK); > > - sum_rot =3D (panel_rot + cmdline_rot) % 4; > > + panel_rot =3D ilog2(*rotation & DRM_MODE_ROTATE_MASK); > > + cmdline_rot =3D ilog2(cmdline->rotation_reflection & DRM_MODE_ROTAT= E_MASK); > > + sum_rot =3D (panel_rot + cmdline_rot) % 4; > > = > > - panel_rest =3D *rotation & ~DRM_MODE_ROTATE_MASK; > > - cmdline_rest =3D cmdline->rotation_reflection & ~DRM_MODE_ROTATE_MAS= K; > > - sum_rest =3D panel_rest ^ cmdline_rest; > > + panel_rest =3D *rotation & ~DRM_MODE_ROTATE_MASK; > > + cmdline_rest =3D cmdline->rotation_reflection & ~DRM_MODE_ROTATE_MA= SK; > > + sum_rest =3D panel_rest ^ cmdline_rest; > > = > > - *rotation =3D (1 << sum_rot) | sum_rest; > > + *rotation =3D (1 << sum_rot) | sum_rest; > > + } else { > > + *rotation ^=3D cmdline->rotation_reflection; > > + } > > } > > = > > /* > > @@ -879,7 +883,8 @@ bool drm_client_rotation(struct drm_mode_set *modes= et, unsigned int *rotation) > > * depending on the hardware this may require the framebuffer > > * to be in a specific tiling format. > > */ > > - if ((*rotation & DRM_MODE_ROTATE_MASK) !=3D DRM_MODE_ROTATE_180 || > > + if (((*rotation & DRM_MODE_ROTATE_MASK) !=3D DRM_MODE_ROTATE_0 && > > + (*rotation & DRM_MODE_ROTATE_MASK) !=3D DRM_MODE_ROTATE_180) || > > !plane->rotation_property) > > return false; > > = > > -- = > > 2.24.1 > > = > > _______________________________________________ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > = > -- = > Ville Syrj=E4l=E4 > Intel _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel