From patchwork Wed Jul 3 10:53:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Connor Abbott X-Patchwork-Id: 809395 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 44FC3181BAC for ; Wed, 3 Jul 2024 10:54:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720004048; cv=none; b=fM+v/1Sk9S0deuBf1tc4YGn51EDEJPL572OufkKJohdg2lM4kvzAoxBqINygerpTQ26HFEF3m1GLbvyDqc2sKJ2auka/hjn2BMPtLytLJYzHoSWe5SuXLBzNhvePJADqWSAEYNuo9js3fhXqNaOnB6zFIZ4N1Vz5VQtHV0HTPmU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720004048; c=relaxed/simple; bh=ZdMtMRO31X+V6beuvRso7CJsy/NAyt2fvdnd65aN32s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GOtZqGOTefV8FCNqvJjVpIJ1dtSOU9m1sQWeAG4z/uXGq3ZuZxp7l7A5kORklF/7r+GRr4SD+hG4axC+D5gHEYgLRYW7Wr+2fXFVJkhK0LNf2ghavSo4ka4Q5kduJN4uf/I9L9ylhYioMV6azTVLntCafua+pmF9GnpFCIHgI5Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RAuULunB; arc=none smtp.client-ip=209.85.221.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RAuULunB" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-356c4e926a3so3050495f8f.1 for ; Wed, 03 Jul 2024 03:54:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720004042; x=1720608842; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=YoQ/61cpIlq23fw1rt3UkH/Z4+LvwLvWjVxNM41NCbU=; b=RAuULunBnUsZ5Zl9SY9Var6loPQ2SFi7S5giMY1ySa9VCMTXNWiyggNpCTl7MJqzBJ OQQFTIMRsSYJqEypvcgobQGkoj6KGg8wj9656W72Sh3tP5YQmakfDx6hsdwRBrnEnqez 2BplnQBeaFEXftYFrqAeiiT6ZiYP0YUAZ4V49nERecf+o8h7V52zPmG+vWDEmongqXoU AqmuMJoKgu5rvxdyinGg68MiGkNchHbQyUGO9wNaFnokOTPU9LoY3RC5HJyIHz0IiFS6 4+LSg+xiylIFHj8x+ZC3mzlUs4mwp/Fz/AH4X0Zz6p+bWaaqnt//Q+vIcjmAxO6v1enA S0GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720004042; x=1720608842; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YoQ/61cpIlq23fw1rt3UkH/Z4+LvwLvWjVxNM41NCbU=; b=HRxEKPB9ciK/bYcBq5cicTaDVuOFziRBofDqvG9XJqfBQuZplOYPurT5rjnZP15sth 8vMYcqmlzWQMjyQfLT/i5H8RPew9q0veP7HO0KZg0Zn8vXOW+CUaGivF17oQuwgN0aXK 8G4a/x0Hh7G8QaL1i3WL51pHAAa8foMubLZRBRRGpjO48/PfGy583ZY2/vAv1IMaAJ+L C66BTYBAibFZrGHzzRDHASk3rlrWayB8zgkwZgVvJjtwWcoxucMHUJtEkV9ruMbuv+zJ 6p7Ls6HuxHrUnyCGnpKnJqbgTc2y8rM+8uAHN9XRf26ZEkCWSye2jtvqZYUxze11BH9I 91Bg== X-Gm-Message-State: AOJu0YwhzXOCZiarXkK85CODWmb8b1ZNVgAjc3DS9R7qF9n1vKLRuPHl +LQunm2JI0EmsayC6QOrv2iA5rsxeuOtn4X/fBHbcrqFRgvYp36D X-Google-Smtp-Source: AGHT+IEbGYZPsB+JYbZokIdcYq9dEvVwv4LgGNiBX/yc7fa5GwFyiPynwjXH5UC22JQ1hAIu5ArNhQ== X-Received: by 2002:adf:f151:0:b0:35f:208e:6172 with SMTP id ffacd0b85a97d-367756b7ea1mr7346067f8f.27.1720004041472; Wed, 03 Jul 2024 03:54:01 -0700 (PDT) Received: from [192.168.0.20] (cpc115152-dals23-2-0-cust532.20-2.cable.virginm.net. [86.12.82.21]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a0d9b1dsm15644879f8f.42.2024.07.03.03.54.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 03:54:00 -0700 (PDT) From: Connor Abbott Date: Wed, 03 Jul 2024 11:53:47 +0100 Subject: [PATCH v2 1/3] drm/msm: Update a6xx register XML Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240703-msm-tiling-config-v2-1-b9da29ab6608@gmail.com> References: <20240703-msm-tiling-config-v2-0-b9da29ab6608@gmail.com> In-Reply-To: <20240703-msm-tiling-config-v2-0-b9da29ab6608@gmail.com> To: Rob Clark , Sean Paul , Konrad Dybcio , Abhinav Kumar , Dmitry Baryshkov , Marijn Suijten Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Connor Abbott X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1720004038; l=103553; i=cwabbott0@gmail.com; s=20240426; h=from:subject:message-id; bh=ZdMtMRO31X+V6beuvRso7CJsy/NAyt2fvdnd65aN32s=; b=B8iKgvfdul154osj/sjLfAzh00CyCXit08R0+/20mKsgHmq47/ITIfjtyYTfbH221TMtxULCQ mEC0YRgSDWUAC/tVckHlPiBUGMj1UvWa8BK2r9uOkU8cczG+WsH4Obh X-Developer-Key: i=cwabbott0@gmail.com; a=ed25519; pk=dkpOeRSXLzVgqhy0Idr3nsBr4ranyERLMnoAgR4cHmY= Update to Mesa commit 81fd13913a97 ("freedreno: Fix RBBM_NC_MODE_CNTL variants"). Signed-off-by: Connor Abbott --- drivers/gpu/drm/msm/registers/adreno/a6xx.xml | 1617 ++++++++++++++++++++++++- 1 file changed, 1603 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/msm/registers/adreno/a6xx.xml b/drivers/gpu/drm/msm/registers/adreno/a6xx.xml index 2dfe6913ab4f..53a453228427 100644 --- a/drivers/gpu/drm/msm/registers/adreno/a6xx.xml +++ b/drivers/gpu/drm/msm/registers/adreno/a6xx.xml @@ -1198,6 +1198,1552 @@ to upconvert to 32b float internally? + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1584,7 +3130,7 @@ to upconvert to 32b float internally? - + + + + + + Disable LRZ feedback writes - + + Allows draws that don't have GRAS_LRZ_CNTL.LRZ_WRITE but have + GRAS_LRZ_CNTL.ENABLE to contribute to LRZ during RENDERING pass. + In sysmem mode GRAS_LRZ_CNTL.LRZ_WRITE is not considered. + + @@ -2270,7 +3831,7 @@ to upconvert to 32b float internally? - 0.0 if GREATER - 1.0 if LESS - + @@ -2284,7 +3845,7 @@ to upconvert to 32b float internally? Disable LRZ based on previous direction and the current one. If DIR_WRITE is not enabled - there is no write to direction buffer. - + @@ -2357,7 +3918,10 @@ to upconvert to 32b float internally? - + + + + @@ -2366,7 +3930,10 @@ to upconvert to 32b float internally? - + + + + @@ -2440,7 +4007,7 @@ to upconvert to 32b float internally? - + @@ -2448,7 +4015,7 @@ to upconvert to 32b float internally? - + @@ -2927,7 +4494,10 @@ to upconvert to 32b float internally? - + + + + @@ -4329,7 +5899,12 @@ to upconvert to 32b float internally? - + + + + @@ -4351,7 +5926,8 @@ to upconvert to 32b float internally? - + + @@ -4582,15 +6158,15 @@ to upconvert to 32b float internally? - + - + - + @@ -4623,6 +6199,19 @@ to upconvert to 32b float internally? + + + + + + + + + + + + + This register clears pending loads queued up by From patchwork Wed Jul 3 10:53:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Connor Abbott X-Patchwork-Id: 809396 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6510E1741C5 for ; Wed, 3 Jul 2024 10:54:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720004046; cv=none; b=SeVROUAiaMo0/oKKHpdK51mjbcpfjQ6nnx06KovyOdAZYL2Xe6OPA5bAc+OIHrxQR2rnVGEmZOOEl1qnt7+ARq4L6ygvJa4i0XGMvoltsyuNu2llHEMjA1sRqAWy1SxCsGz9aq/MrH1WH1wcGDDzvV6KQHp0Qorid5ABi5du78Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720004046; c=relaxed/simple; bh=YqSTQt5dLeLvGVR7Cw3NpcAP/JRh88mVQ19Mjdbd+so=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nXJ6j5/+kJeH702FpiOUsdyhOVHzSx7ehS4x3PgehNFHri7IdkEiiPzLln/MHzXxeXQr5rPSU3otT72DrTHrIeM6lxQgd00MxpeM5Jqsjd6aJRSsCwf6wZaaxwtG7kUNVbemUtnfOd1ygY40Cs0UP9o4Crec8x55HNW6FsINW6c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RLm9T6Ky; arc=none smtp.client-ip=209.85.221.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RLm9T6Ky" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-367975543a8so105686f8f.3 for ; Wed, 03 Jul 2024 03:54:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720004043; x=1720608843; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=eSNGG3GotjTBAlAnmapyQDldxvgMj+vGrJqRSjQ/FdI=; b=RLm9T6Ky49zXkZNn3PdpijE4WbhlxlAzBnItCvcH75XuPNmYOyn0FuBFoA1itsw5H+ WqJattqrm0giVGkONE8gn323433DApSPJhSRBp379kjOUVKo0YpEouLoX9bMJH6WaNFP NwFevWzE3X2QgaPa9A/ZMLitFvuhR0fDfYCNUxYuzPnrWv2GQOKBG7SYUmgHqfaM4z0d SUbE3argJaSARJkJX6HNPdgeKL094meHg2vHP8FJ51XryMhoAa7jyWTBbhw0ut5+g5TS /INoRRuD7n665IGBbYB+m0j9ieuNR8uMBJXp6BI33MxujBjZw7Glb6PwatNfxiQxkhA2 mC0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720004043; x=1720608843; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eSNGG3GotjTBAlAnmapyQDldxvgMj+vGrJqRSjQ/FdI=; b=cThnWteN3b/uI5ax7DVuolVrAfMdM1oCARjUZn1H4hafZ9lktdZJpSOOeDD+OtP2l0 +0NfvLPstVVY3KTdHDpWVj49MgbieJW1dTNGTQ+GLjpfAYrb+CGTiPr4ZGLufzOIvYQb XpFXx6iLddqFS5uNm258flC7ysj0ELlWZAv76gfrUEEu+tX7lkhERWkjsTSwOjEVpL0n SsZr+HtBV2zRmjRusS1MknFfRISCPqOAKOH+0LX3fukTXv2RvKqrVNR1QA2t7zWPWfos E6LD7iYx6JFYKIZkFTKXHwKVahJtLDBJSqHxp+fZFc9uL3k4ZJl51r2mmNvqVlqgSUua t5ig== X-Gm-Message-State: AOJu0YzFzU+YmpE4QpKL+eGDft1MYbwOJ76SlVpGQhRQHlxGDMTLc9zW EMomWBfGVaLgTdGlEjW8q4ZSWkAKyQ/0NwDZpG+k/G8yiWzZ8Zp3 X-Google-Smtp-Source: AGHT+IFbYFGKaiANXXTF8Ajl8YzGmcI1/8803WNaXqJuwoPgXi/1kQzdfs0rqHSfVvkIPq1XqmueVA== X-Received: by 2002:a05:6000:18ae:b0:360:79d4:b098 with SMTP id ffacd0b85a97d-367756bad06mr7567131f8f.29.1720004042449; Wed, 03 Jul 2024 03:54:02 -0700 (PDT) Received: from [192.168.0.20] (cpc115152-dals23-2-0-cust532.20-2.cable.virginm.net. [86.12.82.21]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a0d9b1dsm15644879f8f.42.2024.07.03.03.54.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 03:54:02 -0700 (PDT) From: Connor Abbott Date: Wed, 03 Jul 2024 11:53:48 +0100 Subject: [PATCH v2 2/3] drm/msm: Expand UBWC config setting Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240703-msm-tiling-config-v2-2-b9da29ab6608@gmail.com> References: <20240703-msm-tiling-config-v2-0-b9da29ab6608@gmail.com> In-Reply-To: <20240703-msm-tiling-config-v2-0-b9da29ab6608@gmail.com> To: Rob Clark , Sean Paul , Konrad Dybcio , Abhinav Kumar , Dmitry Baryshkov , Marijn Suijten Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Connor Abbott X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1720004038; l=6571; i=cwabbott0@gmail.com; s=20240426; h=from:subject:message-id; bh=YqSTQt5dLeLvGVR7Cw3NpcAP/JRh88mVQ19Mjdbd+so=; b=Zzxey0YUXABYR+iwfrPaLUlCL6pq087DsQ+FQ2whIMX3wOyYnunXemygLoztY5jm7vfoSW55b OrofpEJ0fd9BxsQQ2B1zxdggowJaEeb3j7GCEbmueBHBlZyDHxKiWhK X-Developer-Key: i=cwabbott0@gmail.com; a=ed25519; pk=dkpOeRSXLzVgqhy0Idr3nsBr4ranyERLMnoAgR4cHmY= According to downstream we should be setting RBBM_NC_MODE_CNTL to a non-default value on a663 and a680, we don't support a663 and on a680 we're leaving it at the wrong (suboptimal) value. Just set it on all GPUs. Similarly, plumb through level2_swizzling_dis which will be necessary on a663. ubwc_mode is expanded and renamed to ubwc_swizzle to match the name on the display side. Similarly macrotile_mode should match the display side. Signed-off-by: Connor Abbott --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 4 ++++ drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 34 +++++++++++++++++---------------- drivers/gpu/drm/msm/adreno/adreno_gpu.h | 32 ++++++++++++++++++++++++++++++- 3 files changed, 53 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c index c003f970189b..33b0f607f913 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c @@ -1788,5 +1788,9 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev) else adreno_gpu->ubwc_config.highest_bank_bit = 14; + /* a5xx only supports UBWC 1.0, these are not configurable */ + adreno_gpu->ubwc_config.macrotile_mode = 0; + adreno_gpu->ubwc_config.ubwc_swizzle = 0x7; + return gpu; } diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index bcaec86ac67a..7c2fdd1e7684 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -493,24 +493,17 @@ static void a6xx_set_cp_protect(struct msm_gpu *gpu) static void a6xx_calc_ubwc_config(struct adreno_gpu *gpu) { - /* Unknown, introduced with A650 family, related to UBWC mode/ver 4 */ gpu->ubwc_config.rgb565_predicator = 0; - /* Unknown, introduced with A650 family */ gpu->ubwc_config.uavflagprd_inv = 0; - /* Whether the minimum access length is 64 bits */ gpu->ubwc_config.min_acc_len = 0; - /* Entirely magic, per-GPU-gen value */ - gpu->ubwc_config.ubwc_mode = 0; - /* - * The Highest Bank Bit value represents the bit of the highest DDR bank. - * This should ideally use DRAM type detection. - */ + gpu->ubwc_config.ubwc_swizzle = 0x6; + gpu->ubwc_config.macrotile_mode = 0; gpu->ubwc_config.highest_bank_bit = 15; if (adreno_is_a610(gpu)) { gpu->ubwc_config.highest_bank_bit = 13; gpu->ubwc_config.min_acc_len = 1; - gpu->ubwc_config.ubwc_mode = 1; + gpu->ubwc_config.ubwc_swizzle = 0x7; } if (adreno_is_a618(gpu)) @@ -536,6 +529,7 @@ static void a6xx_calc_ubwc_config(struct adreno_gpu *gpu) gpu->ubwc_config.amsbc = 1; gpu->ubwc_config.rgb565_predicator = 1; gpu->ubwc_config.uavflagprd_inv = 2; + gpu->ubwc_config.macrotile_mode = 1; } if (adreno_is_7c3(gpu)) { @@ -543,12 +537,12 @@ static void a6xx_calc_ubwc_config(struct adreno_gpu *gpu) gpu->ubwc_config.amsbc = 1; gpu->ubwc_config.rgb565_predicator = 1; gpu->ubwc_config.uavflagprd_inv = 2; + gpu->ubwc_config.macrotile_mode = 1; } if (adreno_is_a702(gpu)) { gpu->ubwc_config.highest_bank_bit = 14; gpu->ubwc_config.min_acc_len = 1; - gpu->ubwc_config.ubwc_mode = 0; } } @@ -564,21 +558,26 @@ static void a6xx_set_ubwc_config(struct msm_gpu *gpu) u32 hbb = adreno_gpu->ubwc_config.highest_bank_bit - 13; u32 hbb_hi = hbb >> 2; u32 hbb_lo = hbb & 3; + u32 ubwc_mode = adreno_gpu->ubwc_config.ubwc_swizzle & 1; + u32 level2_swizzling_dis = !(adreno_gpu->ubwc_config.ubwc_swizzle & 2); gpu_write(gpu, REG_A6XX_RB_NC_MODE_CNTL, + level2_swizzling_dis << 12 | adreno_gpu->ubwc_config.rgb565_predicator << 11 | hbb_hi << 10 | adreno_gpu->ubwc_config.amsbc << 4 | adreno_gpu->ubwc_config.min_acc_len << 3 | - hbb_lo << 1 | adreno_gpu->ubwc_config.ubwc_mode); + hbb_lo << 1 | ubwc_mode); - gpu_write(gpu, REG_A6XX_TPL1_NC_MODE_CNTL, hbb_hi << 4 | + gpu_write(gpu, REG_A6XX_TPL1_NC_MODE_CNTL, + level2_swizzling_dis << 6 | hbb_hi << 4 | adreno_gpu->ubwc_config.min_acc_len << 3 | - hbb_lo << 1 | adreno_gpu->ubwc_config.ubwc_mode); + hbb_lo << 1 | ubwc_mode); - gpu_write(gpu, REG_A6XX_SP_NC_MODE_CNTL, hbb_hi << 10 | + gpu_write(gpu, REG_A6XX_SP_NC_MODE_CNTL, + level2_swizzling_dis << 12 | hbb_hi << 10 | adreno_gpu->ubwc_config.uavflagprd_inv << 4 | adreno_gpu->ubwc_config.min_acc_len << 3 | - hbb_lo << 1 | adreno_gpu->ubwc_config.ubwc_mode); + hbb_lo << 1 | ubwc_mode); if (adreno_is_a7xx(adreno_gpu)) gpu_write(gpu, REG_A7XX_GRAS_NC_MODE_CNTL, @@ -586,6 +585,9 @@ static void a6xx_set_ubwc_config(struct msm_gpu *gpu) gpu_write(gpu, REG_A6XX_UCHE_MODE_CNTL, adreno_gpu->ubwc_config.min_acc_len << 23 | hbb_lo << 21); + + gpu_write(gpu, REG_A6XX_RBBM_NC_MODE_CNTL, + adreno_gpu->ubwc_config.macrotile_mode); } static int a6xx_cp_init(struct msm_gpu *gpu) diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h b/drivers/gpu/drm/msm/adreno/adreno_gpu.h index e1c69bb022d6..6aca9a9e904d 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h @@ -191,12 +191,42 @@ struct adreno_gpu { const struct firmware *fw[ADRENO_FW_MAX]; struct { + /** + * @rgb565_predicator: Unknown, introduced with A650 family, + * related to UBWC mode/ver 4 + */ u32 rgb565_predicator; + /** @uavflagprd_inv: Unknown, introduced with A650 family */ u32 uavflagprd_inv; + /** @min_acc_len: Whether the minimum access length is 64 bits */ u32 min_acc_len; - u32 ubwc_mode; + /** + * @ubwc_swizzle: Whether to enable level 1, 2 & 3 bank swizzling. + * + * UBWC 1.0 always enables all three levels. + * UBWC 2.0 removes level 1 bank swizzling, leaving levels 2 & 3. + * UBWC 4.0 adds the optional ability to disable levels 2 & 3. + * + * This is a bitmask where BIT(0) enables level 1, BIT(1) + * controls level 2, and BIT(2) enables level 3. + */ + u32 ubwc_swizzle; + /** + * @highest_bank_bit: Highest Bank Bit + * + * The Highest Bank Bit value represents the bit of the highest + * DDR bank. This should ideally use DRAM type detection. + */ u32 highest_bank_bit; u32 amsbc; + /** + * @macrotile_mode: Macrotile Mode + * + * Whether to use 4-channel macrotiling mode or the newer + * 8-channel macrotiling mode introduced in UBWC 3.1. 0 is + * 4-channel and 1 is 8-channel. + */ + u32 macrotile_mode; } ubwc_config; /* From patchwork Wed Jul 3 10:53:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Connor Abbott X-Patchwork-Id: 810873 Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE11B181CF0 for ; Wed, 3 Jul 2024 10:54:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720004047; cv=none; b=A3qDVjvCaCPifhYLOKssftpx9eM4fvJCglxWtQrGPXje34RWVIj+sAuP79h7Rkx7ENrkfGZ0VdyL3AaFEfu+iT0zm8vr8Oi63+cW6458X3nMf4T2pAvbpWaCoDNXe2cECimHRHvnqDNo3IFQdX3/QupOMTPt4izCu0KxmVteROg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720004047; c=relaxed/simple; bh=NRBL4jAN6hjfyxISVZD05E8syLttrXlZkKCLenRZkDQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kX7AjuxlE2T4h/rKkgqRRHpKWzHDtjixr2lxPwxlIus9vp59CONqx3NX5XgoRKjaf2/N5a0ZMfNPu7LQP+8UvLYG/vmDNGq4EYphBNwANJAfL8XGn2wIIcpzCrPtY5Y2DcK1Pg58XTQfWU3Dg67jOXFcjzHY8sYQjII1bq7q48k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MHAe3FTa; arc=none smtp.client-ip=209.85.208.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MHAe3FTa" Received: by mail-lj1-f179.google.com with SMTP id 38308e7fff4ca-2ec4eefbaf1so55597381fa.1 for ; Wed, 03 Jul 2024 03:54:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720004044; x=1720608844; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=X+in5BXb/vtFxcHIZXRWviluH0ffdCxEZJKwCycdffI=; b=MHAe3FTaKszuSNE2y/LPo61aACBO/T1SdzgzaSwKDzf+HIJUaYU2GMXyw4s2BgWya+ 1W7/qGh5L0WFJgo0gRj6XTdPw+FRXNsUuYwnyTDr4LptLenpg1R1GnYjiz4wnNYTy3u/ IGh95WWexAkt7pLyzx5wVRPWogApf4FZMO9iRGexs+dpHxJ5Le+FEcUWGxe/OhVLYof7 G43z370KXQ+cggUMz308yReNbAqpVKtRiUIPcCbS3c8gXkvwyRiG/KZkQuP+sJZj95GT cZ8T80ODDcJySuWLn22AyvBWs2xNgmz3a9oGzTkvVF4Xwp7lKyt82n2/iw6Tu3nC7fug xsvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720004044; x=1720608844; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X+in5BXb/vtFxcHIZXRWviluH0ffdCxEZJKwCycdffI=; b=pGnTjKJx92j17lj5PCBeVrTfnCe2BxcrRT8AxqLroKXRwM+6/v4pl/4fOv9Jm0vBOJ sxrocHtRs+XMSWoTAAIB3cd/2fIckWi2HpVhU/EmFKXD+6Yt87Et1+3M9Bq0Ix1xegFI KyBJpsf80yixwbTQXCDroFBxiKz6LHnvmFQcfMBvQ6nDK2OTi0bcmXPRcWv6DZbSm8oq pkkBatDKYXudd5iOFN6Vamyu/CboYcc7huWJ4jwHuGPCQxefmZNGlxmk8fTTKPVe0Hi5 3AxpenSuYrot4Ro6iNpxdSBaatzDvN1fPb8N9aqMLBjDZEyfy3bOA4iqtwiUHYvbYccS Q2GQ== X-Gm-Message-State: AOJu0YxbIPl83sXhm890n/9fh11nk2POGj9QTjYv9fbARkIPPeI3unKD KbRGjyNj7/P1qqkm/Q2AswUBYXVWt1nt7rD6AMD1e+kJvCWTQrJs X-Google-Smtp-Source: AGHT+IGkQhYp6C4iCdcLdDXmR0eESMCPMl+aTQRH6S1hhLyjnuBSp92V5VZ53UeIKqFXa98xzrHVjQ== X-Received: by 2002:a2e:b169:0:b0:2ee:8817:422b with SMTP id 38308e7fff4ca-2ee8817435emr4552951fa.19.1720004043456; Wed, 03 Jul 2024 03:54:03 -0700 (PDT) Received: from [192.168.0.20] (cpc115152-dals23-2-0-cust532.20-2.cable.virginm.net. [86.12.82.21]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a0d9b1dsm15644879f8f.42.2024.07.03.03.54.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 03:54:03 -0700 (PDT) From: Connor Abbott Date: Wed, 03 Jul 2024 11:53:49 +0100 Subject: [PATCH v2 3/3] drm/msm: Expose expanded UBWC config uapi Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240703-msm-tiling-config-v2-3-b9da29ab6608@gmail.com> References: <20240703-msm-tiling-config-v2-0-b9da29ab6608@gmail.com> In-Reply-To: <20240703-msm-tiling-config-v2-0-b9da29ab6608@gmail.com> To: Rob Clark , Sean Paul , Konrad Dybcio , Abhinav Kumar , Dmitry Baryshkov , Marijn Suijten Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Connor Abbott X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1720004038; l=1686; i=cwabbott0@gmail.com; s=20240426; h=from:subject:message-id; bh=NRBL4jAN6hjfyxISVZD05E8syLttrXlZkKCLenRZkDQ=; b=uOMD0cQHXWYYxQeOFr04/892ck5b1ocEmyn8AQq69zm16OKeU85kklfqTCge7b1j1knvXHGK9 i3zfAdgB7EvBAenyVHWZ44zjKbL20RNSaqmk08J4cUdCWs+BruErspQ X-Developer-Key: i=cwabbott0@gmail.com; a=ed25519; pk=dkpOeRSXLzVgqhy0Idr3nsBr4ranyERLMnoAgR4cHmY= This adds extra parameters that affect UBWC tiling that will be used by the Mesa implementation of VK_EXT_host_image_copy. Signed-off-by: Connor Abbott --- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 6 ++++++ include/uapi/drm/msm_drm.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c index 1c6626747b98..a4d3bc2de8df 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c @@ -379,6 +379,12 @@ int adreno_get_param(struct msm_gpu *gpu, struct msm_file_private *ctx, case MSM_PARAM_RAYTRACING: *value = adreno_gpu->has_ray_tracing; return 0; + case MSM_PARAM_UBWC_SWIZZLE: + *value = adreno_gpu->ubwc_config.ubwc_swizzle; + return 0; + case MSM_PARAM_MACROTILE_MODE: + *value = adreno_gpu->ubwc_config.macrotile_mode; + return 0; default: DBG("%s: invalid param: %u", gpu->name, param); return -EINVAL; diff --git a/include/uapi/drm/msm_drm.h b/include/uapi/drm/msm_drm.h index 3fca72f73861..2377147b6af0 100644 --- a/include/uapi/drm/msm_drm.h +++ b/include/uapi/drm/msm_drm.h @@ -88,6 +88,8 @@ struct drm_msm_timespec { #define MSM_PARAM_VA_SIZE 0x0f /* RO: size of valid GPU iova range (bytes) */ #define MSM_PARAM_HIGHEST_BANK_BIT 0x10 /* RO */ #define MSM_PARAM_RAYTRACING 0x11 /* RO */ +#define MSM_PARAM_UBWC_SWIZZLE 0x12 /* RO */ +#define MSM_PARAM_MACROTILE_MODE 0x13 /* RO */ /* For backwards compat. The original support for preemption was based on * a single ring per priority level so # of priority levels equals the #