From patchwork Sun Dec 26 10:40:57 2021 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: 12699311 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 8CE33C433EF for ; Sun, 26 Dec 2021 10:41:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1B3CF10E6F0; Sun, 26 Dec 2021 10:41:11 +0000 (UTC) Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by gabe.freedesktop.org (Postfix) with ESMTPS id A2D8D10E6F0 for ; Sun, 26 Dec 2021 10:41:09 +0000 (UTC) Received: by mail-wm1-x332.google.com with SMTP id o30so5343687wms.4 for ; Sun, 26 Dec 2021 02:41:09 -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=Ock4A3uoGStWAqVLbKFpQ0G5feZlxJ5tGxucKxVG85VNVRD+NoFnpyyXQBFQW+up/y 5YjQonEU+szM63am1pR3OVzffe4Rg6DVnQiPggbfPYjGlrBM2+eSjcipDUU/T7pQaWjN oO2p/LoWWIzLj5yfgg9KJHPFLA/nndVKJ+aavpNDpqHA0ULByzl6Uno2+mJVfxaWiAq1 KIJ099J6+r6cPfyD+XEKBUK2d6MOGgn53wjVdBcf/o4eVqn46ANPDGZWYiLzQ493NYfw w9z1TFZ2JYl3ZGVggUM0oXgnyPp/gH1Qy+p+JPe77f/3CzMZ5IpYRGWzS2VDL/bk16/e ClbA== 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=3NFg88Zv0Xrdhu1CcbRyEUErI54ZMQU36tmIzn+gHjbzBR+K1FxIaR/6HM7Yh5Gp+0 HYYz6jKm7UNejzFo4Hdblx/3bHfyP7LH8dqnvycqKxIIkhmnw0HGJNQYadJtYgl0FNZn vdxgToFMqMFiLesu1RBXDDZseMEDRaDS01OTuLp8Bm7C5xgqLdROplZDmdsAOwZ1w1BC xIofDmQEejCOwyo7xyWeBqYQIee79z/iVeowP+OzuZ0vDVl/RuU1uoD946uNCqIZeEP/ D0UBQihGAAxsudVJpLIDLmLKlpbizcPTrO55LHh5U6cmmpeLhdQNOBSJOCOJlTQ/80qo ae6g== X-Gm-Message-State: AOAM530V97BvFip4cWdeB4sx+GE2Yl5eihmCw1aovczQT4aT+lcEFEZ2 N8uLoqZHqI8gH3bk2V/2aIU= X-Google-Smtp-Source: ABdhPJzt8QgSrDwaC8ul4L8AhTDytNAzH1P6MVQB50CiqghEZHGW//SXTCTmmRT1vZJ4sWLB0EiNQA== X-Received: by 2002:a7b:c40e:: with SMTP id k14mr9862595wmi.128.1640515267984; Sun, 26 Dec 2021 02:41:07 -0800 (PST) Received: from localhost.localdomain ([217.113.240.86]) by smtp.gmail.com with ESMTPSA id g9sm12592729wmq.22.2021.12.26.02.41.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Dec 2021 02:41:07 -0800 (PST) From: =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= To: melissa.srw@gmail.com Subject: [PATCH v2 1/3] drm/vkms: refactor overlay plane creation Date: Sun, 26 Dec 2021 11:40:57 +0100 Message-Id: <20211226104059.11265-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 --- 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 Sun Dec 26 10:40:58 2021 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: 12699313 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 36DCAC433F5 for ; Sun, 26 Dec 2021 10:41:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BB71810E6F2; Sun, 26 Dec 2021 10:41:14 +0000 (UTC) Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0593D10E6F1 for ; Sun, 26 Dec 2021 10:41:13 +0000 (UTC) Received: by mail-wm1-x333.google.com with SMTP id b73so7884514wmd.0 for ; Sun, 26 Dec 2021 02:41:12 -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=k9o44mibKBF3U3K6MpVibRS05DQ39Bkul1GNZ17pr1M8wR7rI/PVYDPPHit3jxFmmo /Ok6zyd+o7Djl71zz/LUBXTkgTzp3iuturrtFZi59y6BOBYVGuIxzFabexVva7x5+qm8 GsDw/GAkZM5+zxo5tVW6lR83ozxgc+kkgWtJtKzhnUeGOS/Ri15ZxapxHcvmSuluo6LJ s3iI35tiRj39TDbylzOL9gdo//QL+GyNIeT7XtzF4xoqK/cvb87M9rJuQ7ZE29wEdqe0 /YVYOWPhbvj+PQrSySyQh8SJWpUoMUeuoLC1Y9cFvqEF/Ki1cpfk/ZV4amNDcGMHEyFx reMg== 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=y286Xv/Rjs7wkbrQBoQrjjYYFx6t5SMHBN4VuFy6RcXf4EskvhheSuy3Ktm0EuMHZa 3e98VbH6gphVMfd82nRMLhgUAJf8MprWkMNgvntjwnAkceys5kDCbMF3RHmirLRA5pOw hWPICPpy77uI8QD9mCna53a/YYqXW7C06bZqb2gc0Xc1BbbHl7D2Z2ffMgBLQyVoJX8v XS2Roa/8ImW8WyQRc48ZrDEdCJujJX6Ren2qSf56ot2NkIDUICcLDM8xJIau2CY+aKWF Oiy5TblAq8ESwFs/Jn7ipKkA2OQMsIAAaB4AbULv105InL59HryNjf9t+v/1U/JYToqH CjzA== X-Gm-Message-State: AOAM5307yl6hEUPi2mcUD2+a6D6nKeL8J+ooXUNBahBl8y9FniMJtckW 3TIwiI01NSAZIHCwu0WKCpw= X-Google-Smtp-Source: ABdhPJz05AhIC7RinIUTTsIaa8i1N21Jei/lBp2V+EMhlzIwtMLrYG+QsCfrfJcsqgckjmR1Nkwj1A== X-Received: by 2002:a05:600c:4ed3:: with SMTP id g19mr9325342wmq.195.1640515271595; Sun, 26 Dec 2021 02:41:11 -0800 (PST) Received: from localhost.localdomain ([217.113.240.86]) by smtp.gmail.com with ESMTPSA id g9sm12592729wmq.22.2021.12.26.02.41.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Dec 2021 02:41:11 -0800 (PST) From: =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= To: melissa.srw@gmail.com Subject: [PATCH v2 2/3] drm/vkms: add support for multiple overlay planes Date: Sun, 26 Dec 2021 11:40:58 +0100 Message-Id: <20211226104059.11265-2-jose.exposito89@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211226104059.11265-1-jose.exposito89@gmail.com> References: <20211226104059.11265-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 --- 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 Sun Dec 26 10:40:59 2021 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: 12699312 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 C23F6C433FE for ; Sun, 26 Dec 2021 10:41:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B74EA10E6F1; Sun, 26 Dec 2021 10:41:14 +0000 (UTC) Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 00CEC10E6F1 for ; Sun, 26 Dec 2021 10:41:13 +0000 (UTC) Received: by mail-wr1-x42a.google.com with SMTP id r17so26374998wrc.3 for ; Sun, 26 Dec 2021 02:41:13 -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=IVgjJdfFI9JqBDqtDgFrsG6mMMuXOo5LT4CXf8uYQJMP+1UJEIkW+KtT7i23EW/Q1Q wksPThVgIYPfVRKc3etd1TntgDQ/HqR+LfkMVuDnuU79OIRUCEiWw22TT91cvY86HVFv 0D19oVPZZfNxQWWWow5EOYqb1NnRhhUGCufvlyO9iNrmQ4jvsEZDUsu3A6yeT0n2CjZX mE0cAQsKXVljzX0/+zKj9n06NR2JIGQQ+ESM3dFfFQeFi1Ue/9JgpFhFtUXTF4xjUiXd vQsuXEK/dXWZd94Yd8uI0k8ridXIgutOqUGjCFCL7KczAnsXe1gsUo+bwYNc7cz7HzUN 1CVw== 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=XJTRBkQh4CxSXGIdd9lNlNiroQgXdhN4Lfw24z0xVM2JcUReR5tQG/kxLLtXDRgRju MNWXC2yCw8fnFo9cqBtdnDYsC8MfpTq/9II4Aot2axUZW3NX6x3v7lVesynpuVEDwmjR zVTb7NdU6kjbewGLrNP5hQEI8uWmhNDQxtnSUE4ZrfbaqySGFovmwvUSL8qE79EmTxcg QIKhuPfv9klCjNRyoTASlwovlmWY9sCpn8SPquiajPuBj8Uz32ReUuCXEYgA/e5HUrme Tpu/X5yF502Y91LYYLi7NiQEQiByFNbaqLO2/vM3OlJIC8w/8ujFVnx+v2S4KkRoAgo0 V5JA== X-Gm-Message-State: AOAM533tWJqrhh9gPdLmtNnd2B4D2k7/3nAjMyZ314GkkpdmEERjpFvY HpUJQmLoOGrwr6Bx7wfmqqdi0hIC/LGmgA== X-Google-Smtp-Source: ABdhPJxMy8Ln4GlG/YF/pknetTJtI5gnctb6Y9F66+nXLcd6KQuxdSnO6R2xu8qF87P9acttOBLUeA== X-Received: by 2002:a05:6000:1845:: with SMTP id c5mr9396461wri.499.1640515272517; Sun, 26 Dec 2021 02:41:12 -0800 (PST) Received: from localhost.localdomain ([217.113.240.86]) by smtp.gmail.com with ESMTPSA id g9sm12592729wmq.22.2021.12.26.02.41.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Dec 2021 02:41:12 -0800 (PST) From: =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= To: melissa.srw@gmail.com Subject: [PATCH v2 3/3] drm/vkms: drop "Multiple overlay planes" TODO Date: Sun, 26 Dec 2021 11:40:59 +0100 Message-Id: <20211226104059.11265-3-jose.exposito89@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211226104059.11265-1-jose.exposito89@gmail.com> References: <20211226104059.11265-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 --- 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]