From 45604acefaed8521be68bad651b721bd9084bce1 Mon Sep 17 00:00:00 2001 From: Eduardo Hopperdietzel Date: Sun, 7 Jul 2024 00:49:58 -0400 Subject: [PATCH] Update API doc --- src/lib/SRMConnector.h | 6 +++--- src/lib/SRMCore.h | 23 +---------------------- src/lib/SRMDevice.h | 8 +++----- 3 files changed, 7 insertions(+), 30 deletions(-) diff --git a/src/lib/SRMConnector.h b/src/lib/SRMConnector.h index c946aca..6d2fc7d 100644 --- a/src/lib/SRMConnector.h +++ b/src/lib/SRMConnector.h @@ -133,7 +133,7 @@ SRMDevice *srmConnectorGetDevice(SRMConnector *connector); * This function returns the device responsible for rendering operations for the connector. * * When the **ITSELF** rendering mode is used, this device is the same as the one obtained with srmConnectorGetDevice(). - * However, in the **DUMB** or **CPU** modes, it differs. + * However, in the **PRIME**, **DUMB** or **CPU** modes, it differs. * * @param connector Pointer to the @ref SRMConnector for which you want to obtain the renderer device. * @return Pointer to the @ref SRMDevice responsible for rendering operations for the connector. @@ -513,9 +513,9 @@ UInt32 srmConnectorGetCurrentBufferIndex(SRMConnector *connector); * @brief Returns the number of framebuffers. * * This function returns the number of framebuffers available for the given @ref SRMConnector. - * The count may be 1, 2, or 3, depending on the configuration (e.g., single, double or triple buffering). + * The count may be 2 or 3, depending on the configuration (double or triple buffering). * - * The number of framebuffers can be modified by setting the **SRM_RENDER_MODE_{ITSELF, DUMB, CPU}_FB_COUNT** environment variables. + * The number of framebuffers can be modified by setting the **SRM_RENDER_MODE_{ITSELF, PRIME, DUMB, CPU}_FB_COUNT** environment variables. * * @param connector Pointer to the @ref SRMConnector to query for the number of framebuffers. * @return The number of framebuffers. diff --git a/src/lib/SRMCore.h b/src/lib/SRMCore.h index eb03673..20a4eb1 100644 --- a/src/lib/SRMCore.h +++ b/src/lib/SRMCore.h @@ -18,30 +18,9 @@ extern "C" { * * @warning You must create a single @ref SRMCore instance per process, creating more than one could lead to undefined behavior. * - * ### Automatic Configuration - * - * Here are the steps in which SRM internally finds the best configuration: - * - * @li Obtains the resources and capabilities of each GPU. - * @li Determines which GPU will be used as an allocator, giving priority to allowing as many GPUs as possible to access textures through DMA. - * @li Identifies which GPUs are capable of rendering (the ones that can import textures from the allocator GPU). - * @li If a GPU cannot import textures from the allocator, another GPU is assigned to render for it. - * @li In that case, to display the rendered buffer from the renderer GPU on the connector of the non renderer GPU, SRM prioritizes the use of DUMB BUFFERS and, as a last resort, CPU copying (all this is handled internally by SRM). - * @li When initiating a connector, SRM searches for the best possible combination of ENCODER, CRTC, and PRIMARY PLANE. - * @li SRM also looks for a CURSOR PLANE, which, if available, can assign its pixels and position using the srmConnectorSetCursor() and srmConnectorSetCursorPos() functions. - * @li If no CURSOR PLANE is found because they are all being used by other connectors, the CURSOR PLANE will be automatically added to the connector that needs it once one of those connectors is uninitialized. - * - * ### Connectors Render Modes - * - * These are the possible connectors rendering modes form best to worst case: - * - * @li **ITSELF** : The connector's GPU can directly render into it. - * @li **DUMB** : The connector' GPU creates dumb buffers and DMA map or `glReadPixels()` is used to copy the buffers rendered by another GPU. - * @li **CPU** : Renderer GPU > CPU (DMA map or glReadPixels) > connector GPU (`glTexImage2D()`) > render. - * * ### Framebuffer damage * - * **DUMB** and **CPU** modes can greatly benefit from receiving information about the changes occurring in the buffer within a frame, commonly known as "damage." By providing this damage information, we can optimize the performance of these modes. + * **PRIME**, **DUMB** and **CPU** modes can greatly benefit from receiving information about the changes occurring in the buffer within a frame, commonly known as "damage." By providing this damage information, we can optimize the performance of these modes. * To define the generated damage, after rendering within a `paintGL()` event, you can add an array of rectangles (@ref SRMRect) with the damage area using the srmConnectorSetBufferDamage() function. * It is important to ensure that the coordinates of these rectangles originate from the top-left corner of the framebuffer and do not extend beyond its boundaries to avoid segmentation errors. * The **ITSELF** mode does not benefit from buffer damages, and therefore, calling the function in that case is a no-op. To determine if a connector supports buffer damages, use the srmConnectorHasBufferDamageSupport() function. diff --git a/src/lib/SRMDevice.h b/src/lib/SRMDevice.h index 1c90312..37aea9e 100644 --- a/src/lib/SRMDevice.h +++ b/src/lib/SRMDevice.h @@ -15,7 +15,7 @@ extern "C" { * @brief Representation of an open DRM device, typically a GPU. * * An @ref SRMDevice represents a DRM device, typically a GPU, which can contain multiple connectors - * and a specific rendering mode (**ITSELF**, **DUMB** or **CPU**). + * and a specific rendering mode (**ITSELF**, **PRIME**, **DUMB** or **CPU**). * * @{ */ @@ -179,8 +179,7 @@ UInt8 srmDeviceIsRenderer(SRMDevice *device); /** * @brief Get the device that performs rendering for this device. * - * If the rendering device is equal to this device, then this device's rendering mode is **ITSELF**. - * Otherwise, this device's rendering mode could be **DUMB** or **CPU**, depending on whether it can create DUMB buffers. + * The rendering device is equal to this device only when the **ITSELF** rendering mode is used. * * @param device A pointer to the @ref SRMDevice instance. * @@ -191,8 +190,7 @@ SRMDevice *srmDeviceGetRendererDevice(SRMDevice *device); /** * @brief Get the rendering mode of the device. * - * If the rendering device is equal to this device, then this device's rendering mode is **ITSELF**. - * Otherwise, this device's rendering mode could be **DUMB** or **CPU**, depending on whether it can create DUMB buffers. + * If the rendering device is equal to this device, then the rendering mode is **ITSELF**. * * @param device A pointer to the @ref SRMDevice instance. *