From patchwork Mon May 13 07:50:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louis Chauvet X-Patchwork-Id: 13663130 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 4AE2BC25B10 for ; Mon, 13 May 2024 07:51:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2C8F010E4D1; Mon, 13 May 2024 07:51:05 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.b="Hf/aZe5h"; dkim-atps=neutral Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5D55F10E4C3 for ; Mon, 13 May 2024 07:50:57 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id 6CF3D2000B; Mon, 13 May 2024 07:50:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1715586655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5Rm+coOfyuVkQO9evbSIShb9ufh/OnsJJk+xovmjQ24=; b=Hf/aZe5hL3EQ4+kgN8xM+O0eN7qmURT14NlpMkuOFlzsW7Tl+FnV2zlZsz1EPuGJkEmM1O 98W7SoRp+S8+7Ixexx4qcyzQKn42bEuM12MfJKfdG0teU0RkAb6qd25/TKVwkVgrLTgJ1O m9bwJdEFO97iCpHNr6byubN+liV+KVmVYkmIP7bTZL4Mj7lyKuF0YKDLMr2GQ9pqMyNTuf o2J20QL9zGVu9LSX01otlwJanwWG/6+X9mx3DaytLadz2rDeF/9DNpsIuMK84L62cRxUiG 6sIkBSy+bvFTeAhSafcj9E314CLHo5bdp2h0Y4GqNHGen8QBsBDTH+uVhcVfbg== From: Louis Chauvet Date: Mon, 13 May 2024 09:50:34 +0200 Subject: [PATCH v7 13/17] drm/vkms: Add range and encoding properties to the plane MIME-Version: 1.0 Message-Id: <20240513-yuv-v7-13-380e9ffec502@bootlin.com> References: <20240513-yuv-v7-0-380e9ffec502@bootlin.com> In-Reply-To: <20240513-yuv-v7-0-380e9ffec502@bootlin.com> To: Rodrigo Siqueira , Melissa Wen , =?utf-8?q?Ma=C3=ADra_Canal?= , Haneen Mohammed , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , rdunlap@infradead.org, arthurgrillo@riseup.net, Jonathan Corbet , pekka.paalanen@haloniitty.fi Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, jeremie.dautheribes@bootlin.com, miquel.raynal@bootlin.com, thomas.petazzoni@bootlin.com, seanpaul@google.com, marcheu@google.com, nicolejadeyee@google.com, Louis Chauvet , Pekka Paalanen X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1253; i=louis.chauvet@bootlin.com; h=from:subject:message-id; bh=5x6LmxTgmFsdwCLT6+4+DnviNaQ8VRiCYQVGWxE2tsU=; b=owEBbQKS/ZANAwAIASCtLsZbECziAcsmYgBmQcZEu29XlTjUhTejDx76AyzVimAYORh5Fhh8a F5pfj3zxJSJAjMEAAEIAB0WIQRPj7g/vng8MQxQWQQgrS7GWxAs4gUCZkHGRAAKCRAgrS7GWxAs 4pajEACV3ZTBEg6tNVSeAgbW0wUJuEHIvejG0md6H6lu2VED4LhfmyW3SQd2qK/7K3T+D6xPH9K bBkAo2nebhW03x+9Az6w8ON7wGRyNDZjkPadapJDauOr4hKt+0q8lQyqcCiEGQgUUkZNdGJDckH x6WoNNq94dC+SCB80i1cppe8Hqwf5qtsI93Evy8SLA7w3mMmi0nATq3ZhfWswOKvE/FbVnDkZAS Bt85vB3BwfQ0WED8FmjkNXd5JdmW7JTMkk3ZQzQX5E51vZr9eAafQAcwdYPKbpZMZmcJBF4mJgX u6HmMIhMcQsSAnovkQcDCJ+KOA46NMS3QMzWjCjcOAeCWEk3ommOiiDMGZ1k0aAQfYDinJOKD5X BRyAH6Gahjg56vVy5uQTwDz9jXkCLbautxeOCs/e9JYhzVW3Lg8iKtwUQbDphix87P08Pvf+U4C h0w2DVD5cCxxQq8+Akbmk792dGb1Q1NBiAIIhb7eUWERnpH8v2+eJNeHy3Fy/SsYB9yS6lQIn4K Y2YzjfxAU5T8iVtl/zOIHn8mnY10XLUJ+hpQWMFcQjmSK1hqVwU+59nPNG1TtCCyNNbv63QHUr7 9/7qZIS59VK9xjocAKGTCtSGQ57hj3xwArMhMoXi0usWGFO7E13VBe/lY5ApNVz95bCQU+2GPWI 6M41EbUpRp0f+CA== X-Developer-Key: i=louis.chauvet@bootlin.com; a=openpgp; fpr=8B7104AE9A272D6693F527F2EC1883F55E0B40A5 X-GND-Sasl: louis.chauvet@bootlin.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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Arthur Grillo Now that the driver internally handles these quantization ranges and YUV encoding matrices, expose the UAPI for setting them. Signed-off-by: Arthur Grillo [Louis Chauvet: retained only relevant parts, updated the commit message] Acked-by: Pekka Paalanen Signed-off-by: Louis Chauvet --- drivers/gpu/drm/vkms/vkms_plane.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c index d4e375913122..8f764a108b00 100644 --- a/drivers/gpu/drm/vkms/vkms_plane.c +++ b/drivers/gpu/drm/vkms/vkms_plane.c @@ -218,5 +218,14 @@ struct vkms_plane *vkms_plane_init(struct vkms_device *vkmsdev, drm_plane_create_rotation_property(&plane->base, DRM_MODE_ROTATE_0, DRM_MODE_ROTATE_MASK | DRM_MODE_REFLECT_MASK); + drm_plane_create_color_properties(&plane->base, + BIT(DRM_COLOR_YCBCR_BT601) | + BIT(DRM_COLOR_YCBCR_BT709) | + BIT(DRM_COLOR_YCBCR_BT2020), + BIT(DRM_COLOR_YCBCR_LIMITED_RANGE) | + BIT(DRM_COLOR_YCBCR_FULL_RANGE), + DRM_COLOR_YCBCR_BT601, + DRM_COLOR_YCBCR_FULL_RANGE); + return plane; }