Skip to contentSkip to conversation

drm/amdgpu: read TRUNCATE_COORD_MODE on gfx12

PATCH In review Qiang Yu 3 participants 3 messages Jul 23 – Jul 27

Subsystems (2)
lore
Share & tools
lore

Qiang Yu

author
#0 lore raw

PATCH 1/1 drm/amdgpu: read TRUNCATE_COORD_MODE on gfx12

From: Qiang Yu <[email protected]>

TA_CNTL2.TRUNCATE_COORD_MODE selects whether texture coordinate truncation is D3D9/GL/Vulkan conformant. gfx11 reads it and reports it to userspace via AMDGPU_IDS_FLAGS_CONFORMANT_TRUNC_COORD, but gfx12 never read it, so the flag was always reported as 0 and userspace fell back to the non-conformant path.

Read it in gfx_v12_0_constants_init() like gfx11 does.

Fixes 52cb80c12e8a ("drm/amdgpu: Add gfx v12_0 ip block support (v6)")
---
 drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +6 -0
index b3887c5262a0..d109fa06e32a 100644
@@ -1827,6 +1827,12 @@ static void gfx_v12_0_constants_init(struct amdgpu_device *adev)
 	gfx_v12_0_get_cu_info(adev, &adev->gfx.cu_info);
 	gfx_v12_0_get_tcc_info(adev);
 	adev->gfx.config.pa_sc_tile_steering_override = 0;
+
+	/* Set whether texture coordinate truncation is conformant. */
+	tmp = RREG32_SOC15(GC, 0, regTA_CNTL2);
+	adev->gfx.config.ta_cntl2_truncate_coord_mode =
+		REG_GET_FIELD(tmp, TA_CNTL2, TRUNCATE_COORD_MODE);
+
 	/* Program DB_RING_CONTROL for multiple GFX pipes
 	 * Default power up value is 1.
 	 * Possible values:
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw

Marek

Quoted 37 lines · Qiang Yu

From: Qiang Yu <[email protected]>

TA_CNTL2.TRUNCATE_COORD_MODE selects whether texture coordinate truncation is D3D9/GL/Vulkan conformant. gfx11 reads it and reports it to userspace via AMDGPU_IDS_FLAGS_CONFORMANT_TRUNC_COORD, but gfx12 never read it, so the flag was always reported as 0 and userspace fell back to the non-conformant path.

Read it in gfx_v12_0_constants_init() like gfx11 does.

Fixes 52cb80c12e8a ("drm/amdgpu: Add gfx v12_0 ip block support (v6)")
---
 drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +6 -1
index b3887c5262a0..d109fa06e32a 100644
@@ -1827,6 +1827,12 @@ static void gfx_v12_0_constants_init(struct amdgpu_device *adev)
        gfx_v12_0_get_cu_info(adev, &adev->gfx.cu_info);
        gfx_v12_0_get_tcc_info(adev);
        adev->gfx.config.pa_sc_tile_steering_override = 0;
+
+       /* Set whether texture coordinate truncation is conformant. */
+       tmp = RREG32_SOC15(GC, 0, regTA_CNTL2);
+       adev->gfx.config.ta_cntl2_truncate_coord_mode =
+               REG_GET_FIELD(tmp, TA_CNTL2, TRUNCATE_COORD_MODE);
+
        /* Program DB_RING_CONTROL for multiple GFX pipes
         * Default power up value is 1.
         * Possible values:
--

2.43.0

Reviewed-by on v1 1/1
#2 lore raw
In reply to Qiang Yu
Quoted 9 lines · Qiang Yu

From: Qiang Yu <[email protected]>

TA_CNTL2.TRUNCATE_COORD_MODE selects whether texture coordinate truncation is D3D9/GL/Vulkan conformant. gfx11 reads it and reports it to userspace via AMDGPU_IDS_FLAGS_CONFORMANT_TRUNC_COORD, but gfx12 never read it, so the flag was always reported as 0 and userspace fell back to the non-conformant path.

Quoted 3 lines

Read it in gfx_v12_0_constants_init() like gfx11 does.

Fixes 52cb80c12e8a ("drm/amdgpu: Add gfx v12_0 ip block support (v6)")
Quoted 25 lines
---
 drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +6 -1
index b3887c5262a0..d109fa06e32a 100644
@@ -1827,6 +1827,12 @@ static void gfx_v12_0_constants_init(struct amdgpu_device *adev)
        gfx_v12_0_get_cu_info(adev, &adev->gfx.cu_info);
        gfx_v12_0_get_tcc_info(adev);
        adev->gfx.config.pa_sc_tile_steering_override = 0;
+
+       /* Set whether texture coordinate truncation is conformant. */
+       tmp = RREG32_SOC15(GC, 0, regTA_CNTL2);
+       adev->gfx.config.ta_cntl2_truncate_coord_mode =
+               REG_GET_FIELD(tmp, TA_CNTL2, TRUNCATE_COORD_MODE);
+
        /* Program DB_RING_CONTROL for multiple GFX pipes
         * Default power up value is 1.
         * Possible values:
--

2.43.0