From patchwork Fri Jan 7 18:28:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= X-Patchwork-Id: 12706921 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 DDDC7C433EF for ; Fri, 7 Jan 2022 18:28:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D7E1310EAA6; Fri, 7 Jan 2022 18:28:15 +0000 (UTC) Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 39B0E10EAA6 for ; Fri, 7 Jan 2022 18:28:14 +0000 (UTC) Received: by mail-wm1-x32e.google.com with SMTP id o30so4514802wms.4 for ; Fri, 07 Jan 2022 10:28:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=iBIfrfnr3GLdb1qUMNUHlNu3PuJL3644gLoGb9X9DGQ=; b=EVQui/6Rka9+gaqd2Lzk5fQ3Mi3OfoZA8B4MAlgughIVrqnlgxpmIJOgkaQFPQIRMp 0FOiOEu38cyYgLswHTUAJkZugAEISKSTlONL00Cuz3ZCm1PZ3jju8c6D4pTKhQqaAW+p eS3IIMAriMzs4/27LMuFLpNrfe/CUnVYZ4ZO1UGKYFJyh5nVQcXsACGfjtDTO7R9Pfy4 isElT3hkg3jeIIXLVc/NlMv+vvus9tddgAnPqek9YEO6o2N41RQMh/HfiJQF2Q6kH8AV 7eO9afYNNHWJB25A1NUQm/pT3/GVmdgxAf/QI/NofR+tRTVyrzYrRymHZRxMuPAQEe5+ D6TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=iBIfrfnr3GLdb1qUMNUHlNu3PuJL3644gLoGb9X9DGQ=; b=c0WPI3R/gUgzPCtqpCY5wWfl2CRhcqlgJ2AZyqD3d7DUfLtcT/+USS/DsSIYU1CQ2K j2cuTBoTREvH8cYpj0Ge1KWu0RGbIt3ECTwCJEn3rF7RmmgHs8CzX4fftV8DxWfsJ8MN A+rxPCdRy2hUcyRDzLE8Ef/XVO6nleb25XXVOk5x8cgK5CyI16ig32h+eY3+d1JsOXlw ra9Ydn+Pfa1oQrVDh9o9ZLvi7nXpLYxFSlzzNSIZYKp9CNcjFt7Ct7cyVEpRd80gI7ox aY4KcP2QNQEa+riRhLiN8AmNYkQiBI7PowakexvnGZIivYLIiOhAeizQeF9lq5AHPU2F zMZg== X-Gm-Message-State: AOAM5315s4SZbwbYVgOh2hRUU5BJwBcdwjC0bbERVlFLEVz+yHsY6Nxj G+xe+cX7cQGXqNi/rYaCRXo= X-Google-Smtp-Source: ABdhPJzcXNU1oVPwdUqSiPF6gH0piyIBj1KSJz3M+SIp6nsUqMIPwe7Nnh2a4lhVYplw+ffwWGGoOA== X-Received: by 2002:a05:600c:4e4b:: with SMTP id e11mr12054556wmq.28.1641580092750; Fri, 07 Jan 2022 10:28:12 -0800 (PST) Received: from localhost.localdomain ([217.113.240.86]) by smtp.gmail.com with ESMTPSA id p62sm4913499wmp.10.2022.01.07.10.28.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 10:28:12 -0800 (PST) From: =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= To: melissa.srw@gmail.com Subject: [PATCH RESEND v2 1/3] drm/vkms: refactor overlay plane creation Date: Fri, 7 Jan 2022 19:28:07 +0100 Message-Id: <20220107182809.141003-1-jose.exposito89@gmail.com> X-Mailer: git-send-email 2.25.1 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: hamohammed.sa@gmail.com, rodrigosiqueiramelo@gmail.com, airlied@linux.ie, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, mwen@igalia.com, =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Move the logic to create an overlay plane to its own function. Refactor, no functional changes. Signed-off-by: José Expósito Reviewed-by: Melissa Wen --- drivers/gpu/drm/vkms/vkms_output.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c index 04406bd3ff02..2e805b2d36ae 100644 --- a/drivers/gpu/drm/vkms/vkms_output.c +++ b/drivers/gpu/drm/vkms/vkms_output.c @@ -32,6 +32,21 @@ static const struct drm_connector_helper_funcs vkms_conn_helper_funcs = { .get_modes = vkms_conn_get_modes, }; +static int vkms_add_overlay_plane(struct vkms_device *vkmsdev, int index, + struct drm_crtc *crtc) +{ + struct vkms_plane *overlay; + + overlay = vkms_plane_init(vkmsdev, DRM_PLANE_TYPE_OVERLAY, index); + if (IS_ERR(overlay)) + return PTR_ERR(overlay); + + if (!overlay->base.possible_crtcs) + overlay->base.possible_crtcs = drm_crtc_mask(crtc); + + return 0; +} + int vkms_output_init(struct vkms_device *vkmsdev, int index) { struct vkms_output *output = &vkmsdev->output; @@ -39,7 +54,7 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index) struct drm_connector *connector = &output->connector; struct drm_encoder *encoder = &output->encoder; struct drm_crtc *crtc = &output->crtc; - struct vkms_plane *primary, *cursor = NULL, *overlay = NULL; + struct vkms_plane *primary, *cursor = NULL; int ret; int writeback; @@ -48,12 +63,9 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index) return PTR_ERR(primary); if (vkmsdev->config->overlay) { - overlay = vkms_plane_init(vkmsdev, DRM_PLANE_TYPE_OVERLAY, index); - if (IS_ERR(overlay)) - return PTR_ERR(overlay); - - if (!overlay->base.possible_crtcs) - overlay->base.possible_crtcs = drm_crtc_mask(crtc); + ret = vkms_add_overlay_plane(vkmsdev, index, crtc); + if (ret) + return ret; } if (vkmsdev->config->cursor) { From patchwork Fri Jan 7 18:28:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= X-Patchwork-Id: 12706922 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 CD8DEC433FE for ; Fri, 7 Jan 2022 18:28:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 81AED10EB79; Fri, 7 Jan 2022 18:28:17 +0000 (UTC) Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6215E10EAA6 for ; Fri, 7 Jan 2022 18:28:15 +0000 (UTC) Received: by mail-wm1-x331.google.com with SMTP id q141-20020a1ca793000000b00347b48dfb53so1303731wme.0 for ; Fri, 07 Jan 2022 10:28:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=u/cIP//uzFRFV87jVN39f0dog6UQJqLvS7DxqTem8FA=; b=omF6CXERZiso6S/q+xBfFG4E6S/jaE5rhg2lyaB1S0VsuJykXq2QgUaB5S1UQAJqtB oECLCGvRwZoytXrxX2PyxZFavqhxT2aTAlIDOUOtmvY5K+3r3Vyt5usx6LZXuJOSpFLq GDM1clQaRGsLAC08w8hhuTKV+JNvEgBpVo1q29+LprgQvraZVP/qA3j5q8CNTzK7mrxl HP+VctVlrDjf3X+wdeHTldpAaURkah2hCUw9IfXGMAE96voKDMG+VcvzOxljJSbIFtv7 GZm+TChh7JheMXrgOMEw7+3fuSQS0+CodckyVpLpMaaagvJ83sC4zk2SkpiIAQc2Stqv GFSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u/cIP//uzFRFV87jVN39f0dog6UQJqLvS7DxqTem8FA=; b=x8CQvkwAc8mUtOw3+DrZ7ULYZQTFcaJ+p3xsuZi/XDKA5xGyCpZ8wG70z5zP7R87+r mcxD/EnjBPRoYp2S0jX122necB6X1SCpQzcM3OcsO3TZeNsDdNj1bb/AazRg7Cg53+Xq jtt8rSUojU+dpWAkZrUoQRFjSpiyagiAnpWuifi+5H282+vjvxs4Rfoe13mWpBEqHO00 odK3R/+q0TeuNEoPjkUuuWba8KBa2myAzrj/YzTwvjOYYJpBjceyvdRhKvzsvbLWN9ZL so5sivbmSqU/S8Qz45Wylvm3hMJ2EW9xHzwb4cWYo3v28hozB1PI296lnRnK5IACkGSW 7XnQ== X-Gm-Message-State: AOAM530Ct6J2zfjyCH737/ETBUaeZFKGI68QUq91kyKtivGLfcgHtLGu FYiunFZ6kIcC1CYegmld6JM= X-Google-Smtp-Source: ABdhPJzgi0ea+eTwdq3v8ZTeIM8py3U0zCuqsI7NW7v8/Iaophy4AcWFjxE+mAZuZRI3V4JPClnmWg== X-Received: by 2002:a7b:c1c6:: with SMTP id a6mr1706234wmj.182.1641580093982; Fri, 07 Jan 2022 10:28:13 -0800 (PST) Received: from localhost.localdomain ([217.113.240.86]) by smtp.gmail.com with ESMTPSA id p62sm4913499wmp.10.2022.01.07.10.28.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 10:28:13 -0800 (PST) From: =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= To: melissa.srw@gmail.com Subject: [PATCH RESEND v2 2/3] drm/vkms: add support for multiple overlay planes Date: Fri, 7 Jan 2022 19:28:08 +0100 Message-Id: <20220107182809.141003-2-jose.exposito89@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220107182809.141003-1-jose.exposito89@gmail.com> References: <20220107182809.141003-1-jose.exposito89@gmail.com> 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: hamohammed.sa@gmail.com, rodrigosiqueiramelo@gmail.com, airlied@linux.ie, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, mwen@igalia.com, =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Create 8 overlay planes instead of 1 when the "enable_overlay" module parameter is set. The following igt-gpu-tools tests were executed without finding regressions. Notice than the numbers are identical: | master branch | this patch | | SUCCESS | SKIP | FAIL | SUCCESS | SKIP | FAIL | kms_atomic | 10 | 02 | 00 | 10 | 02 | 00 | kms_plane_cursor | 09 | 45 | 00 | 09 | 45 | 00 | kms_plane_multiple | 01 | 23 | 00 | 01 | 23 | 00 | kms_writeback | 04 | 00 | 00 | 04 | 00 | 00 | Signed-off-by: José Expósito Reviewed-by: Melissa Wen --- v2: - Set the number of overlay planes as a constant instead of as a module parameter (Melissa Wen) - Add a test results in the commit message (Melissa Wen) --- drivers/gpu/drm/vkms/vkms_drv.h | 2 ++ drivers/gpu/drm/vkms/vkms_output.c | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h index d48c23d40ce5..9496fdc900b8 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.h +++ b/drivers/gpu/drm/vkms/vkms_drv.h @@ -20,6 +20,8 @@ #define XRES_MAX 8192 #define YRES_MAX 8192 +#define NUM_OVERLAY_PLANES 8 + struct vkms_writeback_job { struct dma_buf_map map[DRM_FORMAT_MAX_PLANES]; struct dma_buf_map data[DRM_FORMAT_MAX_PLANES]; diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c index 2e805b2d36ae..ba0e82ae549a 100644 --- a/drivers/gpu/drm/vkms/vkms_output.c +++ b/drivers/gpu/drm/vkms/vkms_output.c @@ -57,15 +57,18 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index) struct vkms_plane *primary, *cursor = NULL; int ret; int writeback; + unsigned int n; primary = vkms_plane_init(vkmsdev, DRM_PLANE_TYPE_PRIMARY, index); if (IS_ERR(primary)) return PTR_ERR(primary); if (vkmsdev->config->overlay) { - ret = vkms_add_overlay_plane(vkmsdev, index, crtc); - if (ret) - return ret; + for (n = 0; n < NUM_OVERLAY_PLANES; n++) { + ret = vkms_add_overlay_plane(vkmsdev, index, crtc); + if (ret) + return ret; + } } if (vkmsdev->config->cursor) { From patchwork Fri Jan 7 18:28:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= X-Patchwork-Id: 12706923 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 134B5C433F5 for ; Fri, 7 Jan 2022 18:28:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 610DA10EB91; Fri, 7 Jan 2022 18:28:18 +0000 (UTC) Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5ECF310EB79 for ; Fri, 7 Jan 2022 18:28:16 +0000 (UTC) Received: by mail-wm1-x32e.google.com with SMTP id 2-20020a05600c02c200b003470f96e778so3234131wmn.5 for ; Fri, 07 Jan 2022 10:28:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=urda7dukOjrduEUTaGt81lKPi62bFg/eZfAHEnqnCIg=; b=gloVyOKLDM2n1melDN1jmsJswfStK3ckg1+saVhwtTmTctR15QrSoAldJg3BvggjMu EMSAhEHWrUUJIcmNO8eUXXpPdhcs2Q9TEDoV9A8QUCZaJ06i71G2ecpm9sgzwZJOeaao +cFOXqdTWRSJHR9nRxw5VwK3WDU3tj2LyVZEmRtE2jcEukXEp2wFW4qex3Ghd1AC9V36 20Oh2t76aZKkViz0LnwkcYHrAMnZ8P0jozlv/QPJfjPRkk3fS92i9S4IH9SFY/JQeP/r eC3dmHvrUmsm9ZCqGjhaWR9T1y6WOan8BCKr5WM5KrlBcMFOi4CDtmTYy9mk6WZFRF8Y Tx8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=urda7dukOjrduEUTaGt81lKPi62bFg/eZfAHEnqnCIg=; b=6O731IFuUqEVOF+1a/N8LGYT98N5WlwyLxrRnK2n5NXmk7DGxLDXC/7ba+sPxUV3GA KbFahaxnYS/injEb0heAnz9q0jgXAKTjhobphdsKQbvm2opoazxqXPgoeuyr//cLTTBj oo0ogu8yacsO1vmxTWcO3hvo052tA+4mbNPO+DomDnfP0cp2ck9pq3m06mvR1Myogp03 tb1pf+iO6AKxvJqSPJOJyiNxudTrCDihx+9MaSGLXhKboKLt2eRfJaVq38O+0oCd8NRQ yfVuN+qS5qqeMdP91nf6uEosskAQnN7YTFQ+YDV9lGAexLq0y6BYHNX+VkfGXctQUDK8 GGTA== X-Gm-Message-State: AOAM530wfEWl/YpA011DhzD6+wkWNhNEPcBc/foTqY2bPpbuciTfWEUN j78+KYjq1U+edFi7nxCgR5Q= X-Google-Smtp-Source: ABdhPJwabAvd1EH2SexXZ080BbdJeepu7hHYBJaMGKOUOUGw2xitoVaOt2tkFDvBpxPtS8ZgYEQ3Qg== X-Received: by 2002:a05:600c:3d8f:: with SMTP id bi15mr12037071wmb.172.1641580095018; Fri, 07 Jan 2022 10:28:15 -0800 (PST) Received: from localhost.localdomain ([217.113.240.86]) by smtp.gmail.com with ESMTPSA id p62sm4913499wmp.10.2022.01.07.10.28.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jan 2022 10:28:14 -0800 (PST) From: =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= To: melissa.srw@gmail.com Subject: [PATCH RESEND v2 3/3] drm/vkms: drop "Multiple overlay planes" TODO Date: Fri, 7 Jan 2022 19:28:09 +0100 Message-Id: <20220107182809.141003-3-jose.exposito89@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220107182809.141003-1-jose.exposito89@gmail.com> References: <20220107182809.141003-1-jose.exposito89@gmail.com> 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: hamohammed.sa@gmail.com, rodrigosiqueiramelo@gmail.com, airlied@linux.ie, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, mwen@igalia.com, =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Remove the task from the TODO list. Signed-off-by: José Expósito Reviewed-by: Melissa Wen --- Documentation/gpu/vkms.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/Documentation/gpu/vkms.rst b/Documentation/gpu/vkms.rst index 941f0e7e5eef..9c873c3912cc 100644 --- a/Documentation/gpu/vkms.rst +++ b/Documentation/gpu/vkms.rst @@ -124,8 +124,6 @@ Add Plane Features There's lots of plane features we could add support for: -- Multiple overlay planes. [Good to get started] - - Clearing primary plane: clear primary plane before plane composition (at the start) for correctness of pixel blend ops. It also guarantees alpha channel is cleared in the target buffer for stable crc. [Good to get started]