From patchwork Wed Jul 12 13:57:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Ser X-Patchwork-Id: 13310411 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 D946AEB64D9 for ; Wed, 12 Jul 2023 13:57:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3DE3A10E539; Wed, 12 Jul 2023 13:57:43 +0000 (UTC) Received: from mail-4317.proton.ch (mail-4317.proton.ch [185.70.43.17]) by gabe.freedesktop.org (Postfix) with ESMTPS id 846B110E538 for ; Wed, 12 Jul 2023 13:57:40 +0000 (UTC) Date: Wed, 12 Jul 2023 13:57:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emersion.fr; s=protonmail; t=1689170257; x=1689429457; bh=uh/hSg5Mos7GcPsQjs1DwkwRZhEL5dUyb4rZKocMWZg=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=sAhT0iUse/lddTyjUqvacQEqDb8HGAS169T/X4kfSRZsO6f3rA2xrQvkM7J3hOn+z Gx4q4O/eN755F/9+Ysorm2AHkresBdo9/t6lkBOM0XSkiYowJt5PzPIvFAAWgvujw1 Npo+3Js599RD1n9VuBq9AEyfz/gYZwRfEJEcNKNHPrOpray+YFTIxwgHEawfFq4rrJ xTYDTbBiyfnwwAqHaMdIDyd3SmHGmjXYvrTjlV962wJLKa9diLebqDlNQoQChhB7Eu S+TXFhRle/jOl7901Fu6Yo7oM0AGw34qOKQXzAPnNfB5v6CdSO4J/UFvOZTZzjOn95 GKHsq7WVFovUg== To: dri-devel@lists.freedesktop.org From: Simon Ser Subject: [PATCH 1/4] drm/doc: use cross-references for macros Message-ID: <20230712135723.173506-1-contact@emersion.fr> Feedback-ID: 1358184:user:proton MIME-Version: 1.0 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: Daniel Vetter , Pekka Paalanen Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" These will show up as monospace, and will get linkified as soon as we document the macro they point to. Signed-off-by: Simon Ser Cc: Pekka Paalanen Cc: Daniel Vetter Acked-by: Pekka Paalanen --- Documentation/gpu/drm-uapi.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/gpu/drm-uapi.rst b/Documentation/gpu/drm-uapi.rst index 65fb3036a580..f2fe6e8bd018 100644 --- a/Documentation/gpu/drm-uapi.rst +++ b/Documentation/gpu/drm-uapi.rst @@ -450,12 +450,12 @@ VBlank event handling The DRM core exposes two vertical blank related ioctls: -DRM_IOCTL_WAIT_VBLANK +:c:macro:`DRM_IOCTL_WAIT_VBLANK` This takes a struct drm_wait_vblank structure as its argument, and it is used to block or request a signal when a specified vblank event occurs. -DRM_IOCTL_MODESET_CTL +:c:macro:`DRM_IOCTL_MODESET_CTL` This was only used for user-mode-settind drivers around modesetting changes to allow the kernel to update the vblank interrupt after mode setting, since on many devices the vertical blank counter is @@ -478,8 +478,8 @@ The index is used in cases where a densely packed identifier for a CRTC is needed, for instance a bitmask of CRTC's. The member possible_crtcs of struct drm_mode_get_plane is an example. -DRM_IOCTL_MODE_GETRESOURCES populates a structure with an array of CRTC ID's, -and the CRTC index is its position in this array. +:c:macro:`DRM_IOCTL_MODE_GETRESOURCES` populates a structure with an array of +CRTC ID's, and the CRTC index is its position in this array. .. kernel-doc:: include/uapi/drm/drm.h :internal: From patchwork Wed Jul 12 13:57:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Ser X-Patchwork-Id: 13310412 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 50588EB64D9 for ; Wed, 12 Jul 2023 13:57:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4333610E538; Wed, 12 Jul 2023 13:57:48 +0000 (UTC) Received: from mail-4323.proton.ch (mail-4323.proton.ch [185.70.43.23]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7C45910E538 for ; Wed, 12 Jul 2023 13:57:46 +0000 (UTC) Date: Wed, 12 Jul 2023 13:57:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emersion.fr; s=protonmail; t=1689170264; x=1689429464; bh=WUWnam85ns9qZ2nPTb/uIxGLMmqFSzAAl5Dt0DC42HM=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=Ev66R5U4bZWd0I8fE+VdjOmqI+QKvsbtHTYJpwcjq2pRbJuoi476ObnQfxP44Ay3a YpA/OHIcD4ZZeeSGWkLtyo8WwsTSR5tzZozymE/1QXX9KEltn9B7dnZI3XMLUIvs/H fU54NkLkpC/HvwtNC2cZhaYGNOJN/NXsv+VHAQ/jeD3CpcMK/7Cya2AbuKMcP0svjD 9Sp77t4aSA8kmUZlLYvcBqowOSTJiLUnRAxgKiGZachF/q5PVJRKImckPpBJfOlzvy yKXeEg01NUsxxbDbF7BZLQDZHR0YUkhTRuCZtH/IVLzcAMdXcUpf25d9DGm5goC9mH CUmicYjCnXb+g== To: dri-devel@lists.freedesktop.org From: Simon Ser Subject: [PATCH 2/4] drm/doc: document interactions between PAGE_FLIP_EVENT and atomic Message-ID: <20230712135723.173506-2-contact@emersion.fr> In-Reply-To: <20230712135723.173506-1-contact@emersion.fr> References: <20230712135723.173506-1-contact@emersion.fr> Feedback-ID: 1358184:user:proton MIME-Version: 1.0 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: Daniel Vetter , Pekka Paalanen Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Explain which CRTCs get an event, and uAPI requirements. Signed-off-by: Simon Ser Cc: Pekka Paalanen Cc: Daniel Vetter --- include/uapi/drm/drm_mode.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h index 92d96a2b6763..c32b171c0ba7 100644 --- a/include/uapi/drm/drm_mode.h +++ b/include/uapi/drm/drm_mode.h @@ -946,6 +946,10 @@ struct hdr_output_metadata { * Request that the kernel sends back a vblank event (see * struct drm_event_vblank) with the &DRM_EVENT_FLIP_COMPLETE type when the * page-flip is done. + * + * When used with the atomic uAPI, vblank events will be sent for every CRTC + * included in the commit. At least one CRTC must be included, and all included + * CRTCs must be turned on. */ #define DRM_MODE_PAGE_FLIP_EVENT 0x01 /** From patchwork Wed Jul 12 13:57:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Ser X-Patchwork-Id: 13310413 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 4D413EB64DA for ; Wed, 12 Jul 2023 13:57:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A8CF710E536; Wed, 12 Jul 2023 13:57:55 +0000 (UTC) Received: from mail-4317.proton.ch (mail-4317.proton.ch [185.70.43.17]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5483B10E53B for ; Wed, 12 Jul 2023 13:57:53 +0000 (UTC) Date: Wed, 12 Jul 2023 13:57:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emersion.fr; s=protonmail; t=1689170271; x=1689429471; bh=YAg7CD5tLq5zt3AGc8ufTHPVU9Fe33Xw6PxBNuCLX2Y=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=ol4LSpZ3Om94qcHZkcI6cshuOBdLqTBKfrukh0L9NsV6Xd1tweA1F5488ngPlY/0Y NtxPm3lw9KprFdLDYKzQmzsIHAUtHgILJc8zgdLMFol5GmQ8O8yFKxVSgWJUFxvBW5 RloaC/bZgf0SKTzwzKI8ds0+9ZQ4jpOJ+SM+uBWYtVxo1lJFUS28lPdeZeXqXUVvqN 9x/aGa7dnlhupgGrFaCyLcEqN+NBDJMLG6btDdhNZxQExh5rTREtmlVNdQ/uGynY5F rxxT0gbw6WtoAaEDJBttB6++j32pwX8AIX1uPdDTJM0ky68I806qq3yUp3g3nThXB8 1e+4TiRMpIi8Q== To: dri-devel@lists.freedesktop.org From: Simon Ser Subject: [RFC PATCH 3/4] drm/doc: document PAGE_FLIP_EVENT | PAGE_FLIP_ASYNC Message-ID: <20230712135723.173506-3-contact@emersion.fr> In-Reply-To: <20230712135723.173506-1-contact@emersion.fr> References: <20230712135723.173506-1-contact@emersion.fr> Feedback-ID: 1358184:user:proton MIME-Version: 1.0 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: Daniel Vetter , Pekka Paalanen , =?utf-8?q?Christian_K=C3=B6n?= =?utf-8?q?ig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Explain what the event looks like when both flags are specified. Signed-off-by: Simon Ser Cc: Pekka Paalanen Cc: Daniel Vetter Cc: Ville Syrjälä Cc: Lyude Paul Cc: Christian König --- Driver developers: please confirm or deny this documentation. I'm just guessing here. include/uapi/drm/drm_mode.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h index c32b171c0ba7..cb4bbfe15d3a 100644 --- a/include/uapi/drm/drm_mode.h +++ b/include/uapi/drm/drm_mode.h @@ -950,6 +950,9 @@ struct hdr_output_metadata { * When used with the atomic uAPI, vblank events will be sent for every CRTC * included in the commit. At least one CRTC must be included, and all included * CRTCs must be turned on. + * + * When used with &DRM_MODE_PAGE_FLIP_ASYNC, the page-flip event will have the + * same timings and sequence number as the previous effective page-flip. */ #define DRM_MODE_PAGE_FLIP_EVENT 0x01 /** From patchwork Wed Jul 12 13:57:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Ser X-Patchwork-Id: 13310414 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 20CB5EB64D9 for ; Wed, 12 Jul 2023 13:58:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 74F3810E53B; Wed, 12 Jul 2023 13:58:00 +0000 (UTC) Received: from mail-4022.proton.ch (mail-4022.proton.ch [185.70.40.22]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6BF9E10E53B for ; Wed, 12 Jul 2023 13:57:58 +0000 (UTC) Date: Wed, 12 Jul 2023 13:57:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emersion.fr; s=protonmail; t=1689170275; x=1689429475; bh=kspUgoiqhSRB7PivdwVOXEGbv83P/jnlrwZxf9UMjLU=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=r/zEA0r21t12FJeBav7M4VdmkQR2BH752c1M++/zrf5Zpeu+V+9XQYf6k1rYQ2qx9 b1W2nUyq+ynAQPuyQOx0g4zNAkH5+5AiHoU5f4IMz9p0OFoS+MDIDumIl6ahIi7+/U iBEe980+HU3YdZSwlY7CxZAEG1HIZmVikSYmOyuVrw2mlaVNBeJ6cdLV7MqH9L0Y3Z ja6XC+G9ff4zsZE9Hv/DT5FmwaSiAw6+plhnt5PxWDxlPOGd3tkDGcTvGvpySwzCz4 p/j7NwoEL2QKfCRau+JpQ9RJnrdSj1Ub/DFKQBbjBZ0dGPRFkK1xeuZQi7EBhpo9Lw h6fZYx9hjb9WQ== To: dri-devel@lists.freedesktop.org From: Simon Ser Subject: [PATCH 4/4] drm/doc: document front-buffer rendering Message-ID: <20230712135723.173506-4-contact@emersion.fr> In-Reply-To: <20230712135723.173506-1-contact@emersion.fr> References: <20230712135723.173506-1-contact@emersion.fr> Feedback-ID: 1358184:user:proton MIME-Version: 1.0 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: Daniel Vetter , Pekka Paalanen Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Explain how to perform front-buffer rendering. Signed-off-by: Simon Ser Cc: Pekka Paalanen Cc: Daniel Vetter --- drivers/gpu/drm/drm_blend.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_blend.c b/drivers/gpu/drm/drm_blend.c index 6e74de833466..6c55f1da2480 100644 --- a/drivers/gpu/drm/drm_blend.c +++ b/drivers/gpu/drm/drm_blend.c @@ -75,6 +75,9 @@ * the currently visible vertical area of the &drm_crtc. * FB_ID: * Mode object ID of the &drm_framebuffer this plane should scan out. + * + * To perform front-buffer rendering, user-space should set FB_ID to the + * previous framebuffer in atomic commits. * CRTC_ID: * Mode object ID of the &drm_crtc this plane should be connected to. *