Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1366552lqp; Mon, 15 Apr 2024 04:37:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV+SAL2gc7ZLT2xwl10pos2PeX4TgtWxgQPJtFmFG8iFeP43/a21B3fSr3VelL7C8wtdSa3fu0xdlQfk8v3rcgc5lNIWFxrja5YGyiesw== X-Google-Smtp-Source: AGHT+IEl2EMO30RlZAtKqhZR/WREtukIHkR+t4ejzlblnrgWV3xI6OkgWlSQrMbyl3Av/6OWbyOJ X-Received: by 2002:a17:903:41cb:b0:1e0:ab65:85e5 with SMTP id u11-20020a17090341cb00b001e0ab6585e5mr12795197ple.1.1713181078216; Mon, 15 Apr 2024 04:37:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713181078; cv=pass; d=google.com; s=arc-20160816; b=pYGgmEMwSVtrp2RRgpBgbd9L0dCn2yAhW/VE7VrRIeMa3wxdY9m5El0RiCmlQP7X2K X9ZPuHtq/sFLPqUQqP5Mbdg8kbmnNVXx/YxzG8sff7cjytwicLiNO2pflgyn8QUJs7K8 kES5pQaqI0l9j7ozD5c868R7rxTIFhnkqNEGXRahfDrlBdRNvwayvl0OHyxc/il7SXoC 0Qb08s6LI6ltmYvMRP1qILLFgz3HVekxs3uJFVLA68b5oAsGbjGAfZW3VxzcrG1OYXpb G3/9cQ3lwvXtG7L820sXX7lu8Jli6iGFeAWtpsJWWtZaIgKJ7mrZID0pdzDhBODL6kwz XxRQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=3nJ0DCbeQBGrsF+3qJOxA8hFZHi5n3mZmYHQXJ6LF2c=; fh=RfqSdiIGRhh7fnRRstUPrFQRliBLzMDQhJeYCMvPhWk=; b=wFNvFOBfAkm2ZIaN2RE6V5wHwknT8D125j/gqnU3AJm/QQq1QUgdcilv/5UMUAtec7 M4jtdOuBuBDjqEG6UqZAMAACi1aVRYySB7NJ+/xkSH5TldFGQWPuL81+eOXi8lLNqzMD i3uMnFkmCfspq8yvfzj8QEXTAVPZbQ8H1dHWHjYjfOY8aloSbAOMv9gHIhL08mA8GLOC 2S8Mw8Hfiao+fjQrPfm9tvkZcLDGnYPl59rB/CbWWybn2fbN9lLAFGc1T2muNZWyd47Y 23bHgDokZ1iBJF79hLMNo0N964p3pvTV5ECJT8PEOtd4Ird8wPV3Wf0A3t7jepQkqSR8 XgUw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=l7pREGxu; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-144995-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144995-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id cp10-20020a170902e78a00b001e3c8b7e39dsi7477864plb.227.2024.04.15.04.37.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 04:37:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-144995-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=l7pREGxu; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-144995-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144995-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 482CDB21C11 for ; Mon, 15 Apr 2024 11:36:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1A42A5FDA5; Mon, 15 Apr 2024 11:36:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="l7pREGxu" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E6425D471 for ; Mon, 15 Apr 2024 11:36:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713180996; cv=none; b=HTQeUCNKgFuwy8gv8fmEiAVtE+K1eEDlWEd7yBV16ffQVxQlhP8V0UEzSQwny8xyuj8iE7+sUZdFZtATUroRi0rOf/gSQm3VoReHW9WoQzDmqHUfL/ipJJTpHRHu4WOlDu0iR2RtyP/wRuIGX+kxeilY3Kp/RJOZjHXU+r4nxWQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713180996; c=relaxed/simple; bh=NfQL2hmUBg97tRXNR6BF3G9eOGsFEkKIBSmc/R4PuPk=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=eh69PSP9LTg8LLqEc/cctUsuVnfYW2ZBYjA+7559GrY84YZMgx4fXrWR14+BfW4ww6IGoEV544WL5vtYikma+0TdKwnZoDF5DWV47jbaUZ/gY+3T3vhMIfb2xVLl0u4kmXzxAnH5EmxSYycdB1/DtuLr/KM2n/7BMGsqAwq6Np0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=l7pREGxu; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713180992; bh=NfQL2hmUBg97tRXNR6BF3G9eOGsFEkKIBSmc/R4PuPk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=l7pREGxuYpAUoYOQydmitKjbEPUv2w5Uwh7YzteYvieYrtUEWUkM71dKHeNBVtqvV A5AT7hbGK4xn4Fiy4c4uu1szX68IbuLFSzZ/PZJNmNSIF2x2COxnLGy8v3Qtpj5Rc2 hFCl1Esn82iZSVLaOC2rHO6Axkp25UPg0SA8TKFkmgX+rWcFE4zu/tCWOTQeydEmTd w2G2QPf//7uIrjJFBgrM1GFfazGhVjCPVdo1Q64wRvkJ4dh+4i7JGh7igEODVrIkjX tqJu2IoUbOkDtVD0fST6puMgj0jPOLIc2uWP4LkqAhobqoqOofg9f9Qf5vVNQfmcTD 9LuwYoXhzEIhg== Received: from eldfell (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pq) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 97C253781FE9; Mon, 15 Apr 2024 11:36:31 +0000 (UTC) Date: Mon, 15 Apr 2024 14:36:22 +0300 From: Pekka Paalanen To: Louis Chauvet Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, seanpaul@google.com, marcheu@google.com, nicolejadeyee@google.com, thomas.petazzoni@bootlin.com Subject: Re: [PATCH 2/3] drm: drm_blend.c: Improve drm_plane_create_rotation_property kernel doc Message-ID: <20240415143622.7e600508.pekka.paalanen@collabora.com> In-Reply-To: <20240409-google-drm-doc-v1-2-033d55cc8250@bootlin.com> References: <20240409-google-drm-doc-v1-0-033d55cc8250@bootlin.com> <20240409-google-drm-doc-v1-2-033d55cc8250@bootlin.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/.eSeiLxVd/0e0PuL12Vqoh1"; protocol="application/pgp-signature"; micalg=pgp-sha256 --Sig_/.eSeiLxVd/0e0PuL12Vqoh1 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 09 Apr 2024 12:04:06 +0200 Louis Chauvet wrote: > The expected behavior of the rotation property was not very clear. Add > more examples to explain what is the expected result. >=20 > Signed-off-by: Louis Chauvet > --- > drivers/gpu/drm/drm_blend.c | 52 +++++++++++++++++++++++++++++++++------= ------ > 1 file changed, 38 insertions(+), 14 deletions(-) >=20 > diff --git a/drivers/gpu/drm/drm_blend.c b/drivers/gpu/drm/drm_blend.c > index 8d4b317eb9d7..6fbb8730d8b0 100644 > --- a/drivers/gpu/drm/drm_blend.c > +++ b/drivers/gpu/drm/drm_blend.c > @@ -104,6 +104,9 @@ > * Without this property the rectangle is only scaled, but not rotated or > * reflected. > * > + * See drm_plane_create_rotation_property() for details about the expect= ed rotation and > + * reflection behavior. I think internal function docs should be referring to UAPI docs, and not vice versa. Internal functions can change, but UAPI cannot. > + * > * Possbile values: > * > * "rotate-": > @@ -114,18 +117,6 @@ > * Signals that the contents of a drm plane is reflected along the > * axis, in the same way as mirroring. > * > - * reflect-x:: > - * > - * |o | | o| > - * | | -> | | > - * | v| |v | > - * > - * reflect-y:: > - * > - * |o | | ^| > - * | | -> | | > - * | v| |o | > - * > * zpos: > * Z position is set up with drm_plane_create_zpos_immutable_property() = and > * drm_plane_create_zpos_property(). It controls the visibility of overl= apping > @@ -266,8 +257,41 @@ EXPORT_SYMBOL(drm_plane_create_alpha_property); > * > * Rotation is the specified amount in degrees in counter clockwise dire= ction, > * the X and Y axis are within the source rectangle, i.e. the X/Y axis = before > - * rotation. After reflection, the rotation is applied to the image samp= led from > - * the source rectangle, before scaling it to fit the destination rectan= gle. > + * rotation. > + * > + * Here are some examples of rotation and reflections: > + * > + * |o +| REFLECT_X |+ o| > + * | | =3D=3D=3D=3D=3D=3D=3D=3D> | | > + * | | | | > + * > + * |o | REFLECT_Y |+ | > + * | | =3D=3D=3D=3D=3D=3D=3D=3D> | | > + * |+ | |o | > + * > + * |o +| ROTATE_90 |+ | > + * | | =3D=3D=3D=3D=3D=3D=3D=3D> | | > + * | | |o | > + * > + * |o | ROTATE_180 | +| > + * | | =3D=3D=3D=3D=3D=3D=3D=3D> | | > + * |+ | | o| > + * > + * |o | ROTATE_270 |+ o| > + * | | =3D=3D=3D=3D=3D=3D=3D=3D> | | > + * |+ | | | > + * > + * Rotation and reflection can be combined to handle more situations. In= this condition, the > + * reflection is applied first and the rotation in second. When going in which direction? Is the first image the FB source rectangle contents, and the second image what the plane looks like in CRTC frame of reference? > + * > + * For example the expected result for DRM_MODE_ROTATE_90 | DRM_MODE_REF= LECT_X is: > + * > + * |o +| REFLECT_X |+ o| ROTATE_90 |o | > + * | | =3D=3D=3D=3D=3D=3D=3D=3D> | | =3D=3D=3D=3D=3D=3D=3D=3D> = | | > + * | | | | |+ | > + * > + * It is not possible to pass multiple rotation at the same time. (i.e R= OTATE_90 | ROTATE_180 is > + * not the same as ROTATE_270 and is not accepted). > */ > int drm_plane_create_rotation_property(struct drm_plane *plane, > unsigned int rotation, >=20 These are definitely improvements. I think they should just be in the UAPI section rather than implementation details. Disclaimer again to everyone else: I cannot tell if this is the correct documentation or its inverse. Thanks, pq --Sig_/.eSeiLxVd/0e0PuL12Vqoh1 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEJQjwWQChkWOYOIONI1/ltBGqqqcFAmYdETYACgkQI1/ltBGq qqf2Ew/+Masv8B8wRuYbVIcLdgdidzSstdy8f/bnjNyM9e3izGX7dQnrgR9gGPIS CIqHP79Sk55p+SHxATK1MslRNDxVwDWVhOFJpG59IP4cgbqcGZUxFy9/lIFbMlx6 0TKlQSdnWVmw1IeKAHqBn0e/85SvbNpMx6XVs8FVp0bcz42kalyAf8fshSddV0AJ WlneYyDt82K/+m7DBIDeUR29PKLbCYNldg29beI1U4Yfy07CXtjr0OCafmfoU8pV 8rarCnpniHlM6sL0/oOr5NFrDeh9OZ/s/x0SYPgONMGLFb9xm0qmp1QvZtgXVATP od2BpB0AE2az09BbqTJF2EDi3THU9sW2kdMl4vDehJ9X3Muo5vQZAsLuh/7GXBYt 1RUU//gTl4Ocbj5iF7vDTGe6JyzxWTCvxiIaWEOi80S/0pxAtRdxlCn5tpiIH+sk 3GIHhqGZHkcPy7Q8qMcUMklnnvHiAhJDn8Ed0c7txY5kVpP84XZZWhk6qeNcvfl5 Xhbt9FiFXW6h8+Sz+dn9QdzWnjRXPTp+rL52GsquQ6HDbwic6nqNZKVP6lbVkF1x K721iSjFqhxt7EdMuVKzzzi7ZjrkPekWDP3fJqkL0tFE3IHJ4wpDn+IJzkAYDjvx 51jSU9nFwuzNIlfhHP14s/7EiqkWe8OgzjdjfcnRNh+dC5P9DN8= =nY+N -----END PGP SIGNATURE----- --Sig_/.eSeiLxVd/0e0PuL12Vqoh1--