From patchwork Fri Jan 26 21:08:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juha-Pekka Heikkila X-Patchwork-Id: 13533320 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 775B2C47DDB for ; Fri, 26 Jan 2024 21:09:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6956A10FEAE; Fri, 26 Jan 2024 21:09:33 +0000 (UTC) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0272210FEAA; Fri, 26 Jan 2024 21:09:30 +0000 (UTC) Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-5102b43035eso385771e87.1; Fri, 26 Jan 2024 13:09:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706303309; x=1706908109; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=w3Ih5o/h7ufYfjrVAuvSf+WnrZ1VWnhrW87zuJwgU6A=; b=DUK2Lu5fchwx4hcI9a+XSxMjzKciRj2/f0m5BEDBCMl6g1wsrCs0L9YvHmqxOHIthr 5CtR4amxuYMSJ7mnP+1ToLe5FsfKtLD4WxCTn0YMwLwjn+QGc4KN85YYBP8RRQ4Ph39Y Ng49pRexIfTt9K/KrazpKFOiT4iDFZMuRjxZTp4bk3rBsuXyKHAT5C9l1ljRY43nKZH5 6Ma1aWP6JdmMjG2aeIrhA5LNZDjf4PAOb+FJyygfOyyLc60jYWTWgRrEgsSpgkM211PH GyH328I2CUy50xX4Qz9+pAHTqnRRMk0HbpPlEOBDg3oi/GGQLUxGXW5ZMtF51mQl11IO tqJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706303309; x=1706908109; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w3Ih5o/h7ufYfjrVAuvSf+WnrZ1VWnhrW87zuJwgU6A=; b=DRIhXWTGkjIzzHmOIhDDQCARHjGbMA8gwfZhCwOG3NSH9848JbI0rpFW4eUuRT/8MZ OppgqTS2LztzXcC/C+sle/yTCdVMjll3dleE8wEFRLqebJOvLpKVBb0tQFY+PWZ8PQGC bUFvHrpAVAmfwOzhvew/KDh+qv02/oumc339MsRYwZB0MvnDQFjlLFMIiAP6BpQNEEBr dtJiIU2GdQg/BG8A44xkr0V2322AxZQ6a41DpWMYc4i+Xg1Gy5eYxLLsl6O7R3WUX9a6 /f8l7tjoi0bpUy0OzsBBulRXwlKbD7TKsM4XCHWEDjKLU5wviJ2XOUZeuQgqdWm3MrQm VSUA== X-Gm-Message-State: AOJu0Yyf0MdCKoNKg2CzYJtRGKK76oXviRPavW0ePkJg+LvPEIg3VZhT k2KiU7pRuV3S7b12nMv0EbJHvgQV9f1Lh1a1N16Ptz3Rdyw8pPKbnnFWgbzuvVA= X-Google-Smtp-Source: AGHT+IFw/WfW1gKWpDcr0TVJm/EpAYyv0DgSBxv+iX5BdTIauRZBE0ymxEwPfw4aHJM8cjrgifvkDg== X-Received: by 2002:a05:6512:2209:b0:50e:4098:3798 with SMTP id h9-20020a056512220900b0050e40983798mr169512lfu.60.1706303308552; Fri, 26 Jan 2024 13:08:28 -0800 (PST) Received: from jheikkil-mobl1.. (91-156-196-125.elisa-laajakaista.fi. [91.156.196.125]) by smtp.gmail.com with ESMTPSA id t3-20020a192d43000000b00510218debaasm290479lft.35.2024.01.26.13.08.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 13:08:28 -0800 (PST) From: Juha-Pekka Heikkila To: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Subject: [PATCH 1/5] drm/xe/pat: annotate pat index table with compression information Date: Fri, 26 Jan 2024 23:08:03 +0200 Message-Id: <20240126210807.320671-2-juhapekka.heikkila@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240126210807.320671-1-juhapekka.heikkila@gmail.com> References: <20240126210807.320671-1-juhapekka.heikkila@gmail.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" add compressed member into xe_pat_table_entry which will contain boolean information if given pat_index is compressed or no. Signed-off-by: Juha-Pekka Heikkila --- drivers/gpu/drm/xe/xe_pat.c | 9 ++++++++- drivers/gpu/drm/xe/xe_pat.h | 8 ++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/xe/xe_pat.c b/drivers/gpu/drm/xe/xe_pat.c index 1ff6bc79e7d4..c3cc6e90b068 100644 --- a/drivers/gpu/drm/xe/xe_pat.c +++ b/drivers/gpu/drm/xe/xe_pat.c @@ -104,7 +104,8 @@ static const struct xe_pat_table_entry xelpg_pat_table[] = { REG_FIELD_PREP(XE2_L3_POLICY, l3_policy) | \ REG_FIELD_PREP(XE2_L4_POLICY, l4_policy) | \ REG_FIELD_PREP(XE2_COH_MODE, __coh_mode), \ - .coh_mode = __coh_mode ? XE_COH_AT_LEAST_1WAY : XE_COH_NONE \ + .coh_mode = __coh_mode ? XE_COH_AT_LEAST_1WAY : XE_COH_NONE, \ + .compressed = comp_en \ } static const struct xe_pat_table_entry xe2_pat_table[] = { @@ -148,6 +149,12 @@ u16 xe_pat_index_get_coh_mode(struct xe_device *xe, u16 pat_index) return xe->pat.table[pat_index].coh_mode; } +bool xe_pat_index_has_compression(struct xe_device *xe, u16 pat_index) +{ + WARN_ON(pat_index >= xe->pat.n_entries); + return xe->pat.table[pat_index].compressed; +} + static void program_pat(struct xe_gt *gt, const struct xe_pat_table_entry table[], int n_entries) { diff --git a/drivers/gpu/drm/xe/xe_pat.h b/drivers/gpu/drm/xe/xe_pat.h index fa0dfbe525cd..c8aacd30b184 100644 --- a/drivers/gpu/drm/xe/xe_pat.h +++ b/drivers/gpu/drm/xe/xe_pat.h @@ -29,6 +29,7 @@ struct xe_pat_table_entry { #define XE_COH_NONE 1 #define XE_COH_AT_LEAST_1WAY 2 u16 coh_mode; + bool compressed; }; /** @@ -58,4 +59,11 @@ void xe_pat_dump(struct xe_gt *gt, struct drm_printer *p); */ u16 xe_pat_index_get_coh_mode(struct xe_device *xe, u16 pat_index); +/** + * xe_pat_index_has_compression - Is pat_index using ccs compression + * @xe: xe device + * @pat_index: The pat_index to query + */ +bool xe_pat_index_has_compression(struct xe_device *xe, u16 pat_index); + #endif From patchwork Fri Jan 26 21:08:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juha-Pekka Heikkila X-Patchwork-Id: 13533323 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 D3E46C48285 for ; Fri, 26 Jan 2024 21:09:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B09B510FEB3; Fri, 26 Jan 2024 21:09:34 +0000 (UTC) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id B3CED10FEAB; Fri, 26 Jan 2024 21:09:31 +0000 (UTC) Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-5101cd91017so749653e87.2; Fri, 26 Jan 2024 13:09:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706303309; x=1706908109; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=997N/5pYMdYJaH4SQ9jdWihdLblZTE/8nf4wQWZMfAY=; b=asCypLEWZ1jsUoqfP8aT+L1dgcsKRn7LNcKmaQy0jIxME0i8cUwth2THI46wp7ut2C 85QzzymTgDpnkAnaMgT/u4m0p/qqYtXD7LW/Ee/ytll7EMqYiPmpz2d7MlBruC3imohl SHQKNkLzv5WQMJP3pZOtIFnrb4wWkcCQa7pJivx0Em131ocRT3JLgawaf5ksX8YQB6ZN QmlmieIs6/Zi3r/n7j11W8O2jDkTcirbnI2hBaQw5E5k1XoywXrLEfzJpYLXIIqu2Lnr t8w2E7Jj6tPdRulHcHk0ieM2ms/e8RVXt1CiI9ZwwbBL0otpKkRfzjg3nGWcj1R28UJw 4now== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706303309; x=1706908109; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=997N/5pYMdYJaH4SQ9jdWihdLblZTE/8nf4wQWZMfAY=; b=Hs6/v5XmxLNDqy74Q7FSf9EFCSxhlICLvIZjtBbcN49e/m9StG2N+8GRET4hIWTxKH QM4T5VL8Ofwe0+Vbwg05iOrdncCp7Act/QBgNwr/n+Jc/2UEkVA3yu6wdNpgWYCn5Elq 3ufxM54fmp4FYCDkZX+XxbNlur76VUryOxvhnGa4XE+/gOzd6kBCcVsnL8yvHuckxRHc PeFI8jOaG2c/2yE/zNDJimWow7vojZZc76bsNgN+zAdQleFoiAk2Z43QkLjzEN+7k/Aj LQs2ytLkrmUNzfNbN6dpyNySIumBXDX4MyQDDXla0lD4V9wInxXmYFrfFW/DQGppvSKu V5gQ== X-Gm-Message-State: AOJu0Yzn7rL1lu5HIcA91xCvAipD4ZXb2fUwGljJVag3S/kXW1PKeUI0 0G+ucbUjYUxjCRHiBlXot1AWavkWMB7lFUiE7Jv1CGny7RQhP2mmdmFwmSS5I/4= X-Google-Smtp-Source: AGHT+IGbm3RWdfGsCm9OMJ8/K+Nlgo7c0NiQYlKiJ9ODaA8hrpvA1pbDdj//NTsItCkO3XCrV0Yq0w== X-Received: by 2002:a05:6512:3ca1:b0:50e:609c:ab90 with SMTP id h33-20020a0565123ca100b0050e609cab90mr185399lfv.32.1706303309363; Fri, 26 Jan 2024 13:08:29 -0800 (PST) Received: from jheikkil-mobl1.. (91-156-196-125.elisa-laajakaista.fi. [91.156.196.125]) by smtp.gmail.com with ESMTPSA id t3-20020a192d43000000b00510218debaasm290479lft.35.2024.01.26.13.08.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 13:08:28 -0800 (PST) From: Juha-Pekka Heikkila To: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Subject: [PATCH 2/5] drm/xe: add bind time pat index to xe_bo structure Date: Fri, 26 Jan 2024 23:08:04 +0200 Message-Id: <20240126210807.320671-3-juhapekka.heikkila@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240126210807.320671-1-juhapekka.heikkila@gmail.com> References: <20240126210807.320671-1-juhapekka.heikkila@gmail.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Add BO bind time pat index member and framebuffer pin time pat index to xe_bo structure. Signed-off-by: Juha-Pekka Heikkila --- drivers/gpu/drm/xe/xe_bo_types.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/xe/xe_bo_types.h b/drivers/gpu/drm/xe/xe_bo_types.h index 14ef13b7b421..ccf63058be66 100644 --- a/drivers/gpu/drm/xe/xe_bo_types.h +++ b/drivers/gpu/drm/xe/xe_bo_types.h @@ -91,6 +91,17 @@ struct xe_bo { /** @vram_userfault_link: Link into @mem_access.vram_userfault.list */ struct list_head vram_userfault_link; + + /** + * @pat_index: The pat index requested when bind this BO + */ + u16 pat_index; + + /** + * @pat_index_scanout: The pat index in use when pinning this BO + * as framebuffer. + */ + u16 pat_index_scanout; }; #define intel_bo_to_drm_bo(bo) (&(bo)->ttm.base) From patchwork Fri Jan 26 21:08:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juha-Pekka Heikkila X-Patchwork-Id: 13533319 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 DAD90C47422 for ; Fri, 26 Jan 2024 21:09:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 67AAD10FEAD; Fri, 26 Jan 2024 21:09:33 +0000 (UTC) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8815610FEAD; Fri, 26 Jan 2024 21:09:32 +0000 (UTC) Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2cf4a22e10dso9083771fa.3; Fri, 26 Jan 2024 13:09:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706303310; x=1706908110; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gAdragFp14ZDf5qrqrIoqQxrVW0ywkpYG2do2M6fgug=; b=CMO2xgGbd3PCtuQaqapiUXxufBFxMsbOWVNfd0aZwpOZyoAOU3XD3+7qxW++4Ab4qB a9LtS8vfdTWi2EW6MDD62ieKe6wJmt0laWgKgNx7DSYVpti+DZKRR3oIOtJkhp/ScN0q i24M7fR67aPOXE/ngaklY3ci0XtN8c0IUKOuzle4EZOCnlCMnCedVy4XRlfm2lY8rfPC dCx7v0q2Bl1a7BGdZDHJlGjb9j0eUcriwItpGjOxElynnkHLBC1COObCdSbcI5xqc949 Yy6HDZvbiBn20wAk+icCNH2EjewmQM4l9ZSImoCJOpcT+ogbN+WO2lXUyw8q3u9XUzfG 7PdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706303310; x=1706908110; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gAdragFp14ZDf5qrqrIoqQxrVW0ywkpYG2do2M6fgug=; b=eCn3S06RPi3KZEHqZJNbh1Ihn9gYqPZsAGYESqj7AvftqMLFIt0XKJK3kPzgaoxZsS 4CFanM/yUyqKUvMO3Vwt+zQeO7Qz+rybBHvLzjFC/L5tLaEcJnOsomBfpDz7Y5RNVsE1 TbfbSvveH+irlhewzxP5sPUJMhKQSSxHkUZ2qLg9qfXD5NWRpSw6jzjBTRuLv+pk4P+/ MhOJQ+TFDFO/enHLKoxmeojac+6eSbjVvOjElKAbqEeD6jcuAFxXWGChQkWmubAGj+Mc 1PCZ4RqjXOU4+ymESv7KLSLr78YkPhAJU6LAe4wEn0fOoQYm6+jhalHqYHwLOfRc+dde ipJQ== X-Gm-Message-State: AOJu0YxmLlmczTnkgDPZXt+CU0L9neravgWmHSrnaaq/htN2x8mEC4xT Edo56lQgH8+ypx4n+1At510zj5IA+g2Qu2E7K+M8RMb9R+wntWNPALoRr4GlxfI= X-Google-Smtp-Source: AGHT+IEIVQev5Ic4tn4HLBA7P1QMy5cGC+L/+Z9OGvPBAi9B21Y8Yg/BWpwvSuuMh8StoK5YHORjOA== X-Received: by 2002:a2e:8503:0:b0:2cf:2efd:84e4 with SMTP id j3-20020a2e8503000000b002cf2efd84e4mr152859lji.184.1706303310186; Fri, 26 Jan 2024 13:08:30 -0800 (PST) Received: from jheikkil-mobl1.. (91-156-196-125.elisa-laajakaista.fi. [91.156.196.125]) by smtp.gmail.com with ESMTPSA id t3-20020a192d43000000b00510218debaasm290479lft.35.2024.01.26.13.08.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 13:08:29 -0800 (PST) From: Juha-Pekka Heikkila To: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Subject: [PATCH 3/5] drm/xe: store bind time pat index to xe_bo Date: Fri, 26 Jan 2024 23:08:05 +0200 Message-Id: <20240126210807.320671-4-juhapekka.heikkila@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240126210807.320671-1-juhapekka.heikkila@gmail.com> References: <20240126210807.320671-1-juhapekka.heikkila@gmail.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Store pat index from xe_vma to xe_bo and check if bo was pinned as framebuffer and verify pat index is not changing for pinned framebuffers. Signed-off-by: Juha-Pekka Heikkila --- drivers/gpu/drm/xe/xe_pt.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_pt.c b/drivers/gpu/drm/xe/xe_pt.c index de1030a47588..0a5d7c7543b1 100644 --- a/drivers/gpu/drm/xe/xe_pt.c +++ b/drivers/gpu/drm/xe/xe_pt.c @@ -1208,10 +1208,11 @@ __xe_pt_bind_vma(struct xe_tile *tile, struct xe_vma *vma, struct xe_exec_queue struct dma_fence *fence; struct invalidation_fence *ifence = NULL; struct xe_range_fence *rfence; + struct xe_bo *bo = xe_vma_bo(vma); int err; bind_pt_update.locked = false; - xe_bo_assert_held(xe_vma_bo(vma)); + xe_bo_assert_held(bo); xe_vm_assert_held(vm); vm_dbg(&xe_vma_vm(vma)->xe->drm, @@ -1252,8 +1253,22 @@ __xe_pt_bind_vma(struct xe_tile *tile, struct xe_vma *vma, struct xe_exec_queue return ERR_PTR(-ENOMEM); } + /* + * BO which has XE_BO_SCANOUT_BIT set and was pinned as framebuffer + * before with different PAT index cannot be bound with different PAT + * index. This is to prevent switching CCS on/off from framebuffers + * on the fly. + */ + if (bo) { + if (bo->flags & XE_BO_SCANOUT_BIT && bo->pat_index_scanout && + bo->pat_index_scanout != vma->pat_index) + return ERR_PTR(-EINVAL); + + bo->pat_index = vma->pat_index; + } + fence = xe_migrate_update_pgtables(tile->migrate, - vm, xe_vma_bo(vma), q, + vm, bo, q, entries, num_entries, syncs, num_syncs, &bind_pt_update.base); @@ -1287,8 +1302,8 @@ __xe_pt_bind_vma(struct xe_tile *tile, struct xe_vma *vma, struct xe_exec_queue DMA_RESV_USAGE_KERNEL : DMA_RESV_USAGE_BOOKKEEP); - if (!xe_vma_has_no_bo(vma) && !xe_vma_bo(vma)->vm) - dma_resv_add_fence(xe_vma_bo(vma)->ttm.base.resv, fence, + if (!xe_vma_has_no_bo(vma) && !bo->vm) + dma_resv_add_fence(bo->ttm.base.resv, fence, DMA_RESV_USAGE_BOOKKEEP); xe_pt_commit_bind(vma, entries, num_entries, rebind, bind_pt_update.locked ? &deferred : NULL); From patchwork Fri Jan 26 21:08:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juha-Pekka Heikkila X-Patchwork-Id: 13533321 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 4229BC47422 for ; Fri, 26 Jan 2024 21:09:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DE7DC10FEB1; Fri, 26 Jan 2024 21:09:33 +0000 (UTC) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 286DF10FEAD; Fri, 26 Jan 2024 21:09:33 +0000 (UTC) Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-51021b25396so935161e87.3; Fri, 26 Jan 2024 13:09:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706303311; x=1706908111; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NhARzpUN4NMOG19a9sc1Be2bMGCGo4IYQc5mki6n3pE=; b=ImrHQ2AloOsn2e+XQCsGUkX1d9l38JadAUU7BTM1MjXk9++rbwImwRlH2yQuRaEgUg 2LJTXpYorY8lQE4zY1mptcCrTFhnq8VT4g7klTZaCk3u8rx9+wUPU3CAID5bZ5VfTGAg HljPiKP7dSVK8L2zS38c2YyQNHFqqyqR5nw8hepPasF1zDmhV+X3rX+HdWlJCeSKSJJd 6lECmeMY/RAnfzanUKfb9d4Wmk7YxiAn2oHEo9KIodxB8tZD6WQLx7zrab4nvU8qLKrP qbR8BktswFGtYT7bvORiTr7i16JV01GXMN3ztM5QJlLkf7ZZ1LJzGRnzxTjCsdxB73EJ 63OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706303311; x=1706908111; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NhARzpUN4NMOG19a9sc1Be2bMGCGo4IYQc5mki6n3pE=; b=H4wMB4pXvqvs/q0NuPSzcgzkcoku4rIWIJO9jwPfL4S96U+d7bnalta5qh+5e1q/6o ygJHcq13/JbEqGgJKWjGN42NZPZZ1Yii7jih+IATTCDWL8MaTkNrh7OcsNNVjIUNDNYU +sLCKdzxidrf048rXQxK1VG0EzGBeQu8J3UZJhsHfzDjn/k6uY5CjnvzO3hPxPXOhWZ8 t3f/hbEBMFKNb1eoXqW46Nl8m38FYExhDttPEUuCTLRQtwya2kRYoer2SzcfGZiaqR3G sWxpYbnPzrBugVSmtS/N32cBHDLO7bFKLyXlQ32jFE/fUD05oe4NPv/8xtEomQiwUVKl y+Fg== X-Gm-Message-State: AOJu0YzlT7GVMHUeqp5yQoZEzNkTzyhD7a2VDMsBEPZeOSD/YKOa3XNa tYrChrDAtrsEnkBm3XnIduuHkk5rxQIE9VVnQLxIEI/mVx6bzujWfr9sETF1i7M= X-Google-Smtp-Source: AGHT+IFlznCfD3T6v0nxdiXxWbV8c9RJUA6JiqFpdxXA8D3hERWpfPXe3Ilu56n0Ofg+E5hzYnzcrg== X-Received: by 2002:a05:6512:3083:b0:510:1bbd:c295 with SMTP id z3-20020a056512308300b005101bbdc295mr183718lfd.37.1706303310890; Fri, 26 Jan 2024 13:08:30 -0800 (PST) Received: from jheikkil-mobl1.. (91-156-196-125.elisa-laajakaista.fi. [91.156.196.125]) by smtp.gmail.com with ESMTPSA id t3-20020a192d43000000b00510218debaasm290479lft.35.2024.01.26.13.08.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 13:08:30 -0800 (PST) From: Juha-Pekka Heikkila To: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Subject: [PATCH 4/5] drm/xe/xe2: Limit ccs framebuffers to tile4 only Date: Fri, 26 Jan 2024 23:08:06 +0200 Message-Id: <20240126210807.320671-5-juhapekka.heikkila@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240126210807.320671-1-juhapekka.heikkila@gmail.com> References: <20240126210807.320671-1-juhapekka.heikkila@gmail.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Display engine support ccs only with tile4, prevent other modifiers from using compressed memory. Store pin time pat index to xe_bo. Signed-off-by: Juha-Pekka Heikkila --- drivers/gpu/drm/xe/display/xe_fb_pin.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/gpu/drm/xe/display/xe_fb_pin.c b/drivers/gpu/drm/xe/display/xe_fb_pin.c index 722c84a56607..b2930a226f54 100644 --- a/drivers/gpu/drm/xe/display/xe_fb_pin.c +++ b/drivers/gpu/drm/xe/display/xe_fb_pin.c @@ -10,9 +10,18 @@ #include "intel_fb_pin.h" #include "xe_ggtt.h" #include "xe_gt.h" +#include "xe_pat.h" #include +static bool is_compressed(const struct drm_framebuffer *fb) +{ + struct xe_bo *bo = intel_fb_obj(fb); + struct xe_device *xe = to_xe_device(to_intel_framebuffer(fb)->base.dev); + + return xe_pat_index_has_compression(xe, bo->pat_index); +} + static void write_dpt_rotated(struct xe_bo *bo, struct iosys_map *map, u32 *dpt_ofs, u32 bo_ofs, u32 width, u32 height, u32 src_stride, u32 dst_stride) @@ -349,12 +358,22 @@ void intel_unpin_fb_vma(struct i915_vma *vma, unsigned long flags) int intel_plane_pin_fb(struct intel_plane_state *plane_state) { struct drm_framebuffer *fb = plane_state->hw.fb; + struct xe_device *xe = to_xe_device(to_intel_framebuffer(fb)->base.dev); struct xe_bo *bo = intel_fb_obj(fb); struct i915_vma *vma; /* We reject creating !SCANOUT fb's, so this is weird.. */ drm_WARN_ON(bo->ttm.base.dev, !(bo->flags & XE_BO_SCANOUT_BIT)); + if (GRAPHICS_VER(xe) >= 20) { + if (fb->modifier != I915_FORMAT_MOD_4_TILED && + is_compressed(fb)) { + drm_warn(&xe->drm, "Cannot create ccs framebuffer with other than tile4 mofifier\n"); + return -EINVAL; + } + bo->pat_index_scanout = bo->pat_index; + } + vma = __xe_pin_fb_vma(to_intel_framebuffer(fb), &plane_state->view.gtt); if (IS_ERR(vma)) return PTR_ERR(vma); From patchwork Fri Jan 26 21:08:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juha-Pekka Heikkila X-Patchwork-Id: 13533322 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 2B986C47422 for ; Fri, 26 Jan 2024 21:09:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A842C10FEB2; Fri, 26 Jan 2024 21:09:34 +0000 (UTC) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by gabe.freedesktop.org (Postfix) with ESMTPS id B737E10FEB0; Fri, 26 Jan 2024 21:09:33 +0000 (UTC) Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-5100fd7f71dso1856249e87.1; Fri, 26 Jan 2024 13:09:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706303312; x=1706908112; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Rv71wG1vxBBHegMPvcinQkXyPZnFxEIY4+DX6mOVEto=; b=XS1oyS/TyuKXa5a9YfxRLmXMuaoNdp8NlMayGJI8gYsnrZCr6UpGsVFOw8trw741Fr IlKjObaYQ0ZrzNCJIl7/zpHvPTdwkUaGO4tEsd/DBmlWX8aI0I0BPA8GLUnb0TqVNn0b DNpG1vtG6u1GR8fhtPv84tVTHd5TSHQD+VDfWqIJ5YHaRWEJzi1o/Ie3tmkshBlHgV6x Q2cexVD+LYwdMFHK5QO+HFZ0HissMX+UxDhOr9rDTQFa4+R6zoJ4HseenVwdVvgMNBhG sqSFm2CnECxz4opJa8H5IpIuHGjPBVgNfflm+XxGwcEGCTz1S1Qv+qOJYbLjRy4Zo8BI LOXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706303312; x=1706908112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Rv71wG1vxBBHegMPvcinQkXyPZnFxEIY4+DX6mOVEto=; b=bvi2O/Zp5v5ZwtP7CRwkTLcwAt/BH49Y6mqiXp2ik0bgQU9v0ND/Mzzrqh2/koXhjX 35ixJyKInq4+fLzmgUmxUQjEyLfbEc0uooV9zxku04r7qRoqCO82FRmM6BIGbIx3b2Ku Rl40NqoWGJI64rGH7peWEiB2uRv1qJvsLOeMUsDXskrscKHPP631HO8CXtXycHTQr+uD 1p2MvykSGb4VLdyUGbWDOiiyCj4F1k6VUfhzkJKzuw8TCPHnft2oHZSNphJDkNmSDUe5 zQ+DfReEbY7trqUq056TMVb7tf2qdcuKquy96zGrkJ3U+Xp72BNwudMbieRXO3JjkVoi ns6Q== X-Gm-Message-State: AOJu0YxpbDq5eKmmCvzCvuhwhfW+Y9ar2w7GidwVkJXvpca1jRvPgub9 Yvjj3WDFFZFSNVCg2pYMx8zGYMFVjiHFwtzNENyyOUyEGtiVR+DW4e7i94iBX/Q= X-Google-Smtp-Source: AGHT+IFVSgm+9SBXaqKuSkez28bVk2gY1wmI1oxXWA1lWUlp0Rv56UGLikbodukmSFcyJMGfKKIMWQ== X-Received: by 2002:ac2:554a:0:b0:510:1840:336c with SMTP id l10-20020ac2554a000000b005101840336cmr196188lfk.52.1706303311664; Fri, 26 Jan 2024 13:08:31 -0800 (PST) Received: from jheikkil-mobl1.. (91-156-196-125.elisa-laajakaista.fi. [91.156.196.125]) by smtp.gmail.com with ESMTPSA id t3-20020a192d43000000b00510218debaasm290479lft.35.2024.01.26.13.08.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 13:08:31 -0800 (PST) From: Juha-Pekka Heikkila To: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Subject: [PATCH 5/5] drm/i915/display: On Xe2 always enable decompression with tile4 Date: Fri, 26 Jan 2024 23:08:07 +0200 Message-Id: <20240126210807.320671-6-juhapekka.heikkila@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240126210807.320671-1-juhapekka.heikkila@gmail.com> References: <20240126210807.320671-1-juhapekka.heikkila@gmail.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" With Xe2 always treat tile4 as if it was using flat ccs. Signed-off-by: Juha-Pekka Heikkila Reviewed-by: Mika Kahola --- drivers/gpu/drm/i915/display/skl_universal_plane.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c index 511dc1544854..43209909593f 100644 --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c @@ -948,6 +948,11 @@ static u32 skl_plane_ctl(const struct intel_crtc_state *crtc_state, if (DISPLAY_VER(dev_priv) == 13) plane_ctl |= adlp_plane_ctl_arb_slots(plane_state); + if (GRAPHICS_VER(dev_priv) >= 20 && + fb->modifier == I915_FORMAT_MOD_4_TILED) { + plane_ctl |= PLANE_CTL_RENDER_DECOMPRESSION_ENABLE; + } + return plane_ctl; }