drm/msm: Add param for the highest bank bit
authorConnor Abbott <cwabbott0@gmail.com>
Thu, 7 Dec 2023 21:30:48 +0000 (21:30 +0000)
committerRob Clark <robdclark@chromium.org>
Sun, 10 Dec 2023 18:19:18 +0000 (10:19 -0800)
This parameter is programmed by the kernel and influences the tiling
layout of images. Exposing it to userspace will allow it to tile/untile
images correctly without guessing what value the kernel programmed, and
allow us to change it in the future without breaking userspace.

Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
Patchwork: https://patchwork.freedesktop.org/patch/571181/
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/adreno/adreno_gpu.c
include/uapi/drm/msm_drm.h

index 3fe9fd240cc73cf732bb3068986a29070030a405..074fb498706f26c0e144c6fd6abd45664bbb93d0 100644 (file)
@@ -373,6 +373,9 @@ int adreno_get_param(struct msm_gpu *gpu, struct msm_file_private *ctx,
                        return -EINVAL;
                *value = ctx->aspace->va_size;
                return 0;
+       case MSM_PARAM_HIGHEST_BANK_BIT:
+               *value = adreno_gpu->ubwc_config.highest_bank_bit;
+               return 0;
        default:
                DBG("%s: invalid param: %u", gpu->name, param);
                return -EINVAL;
index 6f2a7ad04aa407ece8ed7f5bf7b6745bc3d9456b..d8a6b34727601d17e3bd975e3538774a5922f4aa 100644 (file)
@@ -86,6 +86,7 @@ struct drm_msm_timespec {
 #define MSM_PARAM_CMDLINE    0x0d  /* WO: override for task cmdline */
 #define MSM_PARAM_VA_START   0x0e  /* RO: start of valid GPU iova range */
 #define MSM_PARAM_VA_SIZE    0x0f  /* RO: size of valid GPU iova range (bytes) */
+#define MSM_PARAM_HIGHEST_BANK_BIT 0x10 /* RO */
 
 /* For backwards compat.  The original support for preemption was based on
  * a single ring per priority level so # of priority levels equals the #