Skip to content

Commit 16201a1

Browse files
akhilpo-qcomRob Clark
authored andcommitted
drm/msm/adreno: Support AQE engine
AQE (Applicaton Qrisc Engine) is a dedicated core inside CP which aides in Raytracing related workloads. Add support for loading the AQE firmware and initialize the necessary registers. Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Patchwork: https://patchwork.freedesktop.org/patch/689020/ Message-ID: <20251118-kaana-gpu-support-v4-15-86eeb8e93fb6@oss.qualcomm.com> Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
1 parent 288a932 commit 16201a1

4 files changed

Lines changed: 28 additions & 0 deletions

File tree

drivers/gpu/drm/msm/adreno/a6xx_gpu.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,23 @@ static int a6xx_ucode_load(struct msm_gpu *gpu)
11181118
}
11191119
}
11201120

1121+
if (!a6xx_gpu->aqe_bo && adreno_gpu->fw[ADRENO_FW_AQE]) {
1122+
a6xx_gpu->aqe_bo = adreno_fw_create_bo(gpu,
1123+
adreno_gpu->fw[ADRENO_FW_AQE], &a6xx_gpu->aqe_iova);
1124+
1125+
if (IS_ERR(a6xx_gpu->aqe_bo)) {
1126+
int ret = PTR_ERR(a6xx_gpu->aqe_bo);
1127+
1128+
a6xx_gpu->aqe_bo = NULL;
1129+
DRM_DEV_ERROR(&gpu->pdev->dev,
1130+
"Could not allocate AQE ucode: %d\n", ret);
1131+
1132+
return ret;
1133+
}
1134+
1135+
msm_gem_object_set_name(a6xx_gpu->aqe_bo, "aqefw");
1136+
}
1137+
11211138
/*
11221139
* Expanded APRIV and targets that support WHERE_AM_I both need a
11231140
* privileged buffer to store the RPTR shadow
@@ -2400,6 +2417,11 @@ static void a6xx_destroy(struct msm_gpu *gpu)
24002417
drm_gem_object_put(a6xx_gpu->sqe_bo);
24012418
}
24022419

2420+
if (a6xx_gpu->aqe_bo) {
2421+
msm_gem_unpin_iova(a6xx_gpu->aqe_bo, gpu->vm);
2422+
drm_gem_object_put(a6xx_gpu->aqe_bo);
2423+
}
2424+
24032425
if (a6xx_gpu->shadow_bo) {
24042426
msm_gem_unpin_iova(a6xx_gpu->shadow_bo, gpu->vm);
24052427
drm_gem_object_put(a6xx_gpu->shadow_bo);

drivers/gpu/drm/msm/adreno/a6xx_gpu.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ struct a6xx_gpu {
5959

6060
struct drm_gem_object *sqe_bo;
6161
uint64_t sqe_iova;
62+
struct drm_gem_object *aqe_bo;
63+
uint64_t aqe_iova;
6264

6365
struct msm_ringbuffer *cur_ring;
6466
struct msm_ringbuffer *next_ring;

drivers/gpu/drm/msm/adreno/a8xx_gpu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,9 @@ static int hw_init(struct msm_gpu *gpu)
627627
goto out;
628628

629629
gpu_write64(gpu, REG_A8XX_CP_SQE_INSTR_BASE, a6xx_gpu->sqe_iova);
630+
if (a6xx_gpu->aqe_iova)
631+
gpu_write64(gpu, REG_A8XX_CP_AQE_INSTR_BASE_0, a6xx_gpu->aqe_iova);
632+
630633
/* Set the ringbuffer address */
631634
gpu_write64(gpu, REG_A6XX_CP_RB_BASE, gpu->rb[0]->iova);
632635
gpu_write(gpu, REG_A6XX_CP_RB_CNTL, MSM_GPU_RB_CNTL_DEFAULT);

drivers/gpu/drm/msm/adreno/adreno_gpu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ enum {
2727
ADRENO_FW_PFP = 1,
2828
ADRENO_FW_GMU = 1, /* a6xx */
2929
ADRENO_FW_GPMU = 2,
30+
ADRENO_FW_AQE = 3,
3031
ADRENO_FW_MAX,
3132
};
3233

0 commit comments

Comments
 (0)