Skip to content

drm/amdgpu: Support VCE1 IP block (v2)

Timur Kristóf amd-gfx 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest16 patches 15 repliesIn review

Changes in v2 from the cover letter

- Refactor the new GART helper to be reusable
- Reduce reserved GART size from 16 MiB to 2 MiB
- Clear VCPU BO only on device creation
- Save VCPU BO on suspend, restore on resume
- Rework how an empty codec list is handled
- Add different workaround for FirePro W9000
- Address all other feedback from the review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16drm/amdgpu/gmc: Don't hardcode GART page count before GTTdrivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c+4 -16 replies
2/16drm/amdgpu/gmc6: Place gart at low address rangedrivers/gpu/drm/amd/amdgpu/gmc_v6_0.c+1 -10 replies
3/16drm/amdgpu/gmc6: Add GART space for VCPU BO (v2)drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c+3 -00 replies
4/16drm/amdgpu/gart: Add helper to bind VRAM pages (v2)drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c drivers/gpu/drm/amd/amdgpu/amdgpu_gart.h+39 -01 reply
5/16drm/amdgpu/ttm: Use GART helper to map VRAM pages (v2)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c+2 -102 replies
6/16drm/amdgpu/vce: Clear VCPU BO before copying firmware to it (v2)drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c+2 -00 replies
7/16drm/amdgpu/vce: Move firmware load to amdgpu_vce_early_initdrivers/gpu/drm/amd/amdgpu/amdgpu_vce.c drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h drivers/gpu/drm/amd/amdgpu/vce_v2_0.c +2 more+91 -460 replies
8/16drm/amdgpu/vce: Save/restore and pin VCPU BO for all VCE (v2)drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c drivers/gpu/drm/amd/amdgpu/vce_v4_0.c+24 -720 replies
9/16drm/amdgpu/si, cik, vi: Verify IP block when querying video codecs (v2)drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c drivers/gpu/drm/amd/amdgpu/cik.c drivers/gpu/drm/amd/amdgpu/si.c +1 more+23 -25 replies
10/16drm/amdgpu/vce1: Clean up register definitionsdrivers/gpu/drm/amd/amdgpu/sid.h drivers/gpu/drm/amd/include/asic_reg/vce/vce_1_0_d.h drivers/gpu/drm/amd/include/asic_reg/vce/vce_1_0_sh_mask.h+15 -400 replies
11/16drm/amdgpu/vce1: Load VCE1 firmwaredrivers/gpu/drm/amd/amdgpu/amdgpu_vce.c+12 -00 replies
12/16drm/amdgpu/vce1: Implement VCE1 IP block (v2)drivers/gpu/drm/amd/amdgpu/Makefile drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h drivers/gpu/drm/amd/amdgpu/vce_v1_0.c +1 more+818 -11 reply
13/16drm/amdgpu/vce1: Ensure VCPU BO is in lower 32-bit address space (v2)drivers/gpu/drm/amd/amdgpu/vce_v1_0.c+51 -00 replies
14/16drm/amd/pm/si: Hook up VCE1 to SI DPMdrivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c+13 -50 replies
15/16drm/amdgpu/vce1: Enable VCE1 on Tahiti, Pitcairn, Cape Verde GPUsdrivers/gpu/drm/amd/amdgpu/si.c+3 -110 replies
16/16drm/amdgpu/vce1: Workaround PLL timeout on FirePro W9000drivers/gpu/drm/amd/amdgpu/si.c+8 -00 replies

Reviews trailers per patch

10 of 16 patches have a Reviewed-by or Acked-by.

PatchChristian KönigLeo Liu
1/16
2/16R-b
3/16
4/16R-b
5/16R-b
6/16
7/16R-b R-b
8/16
9/16
10/16A-b
11/16R-b
12/16A-b
13/16R-b
14/16R-b
15/16R-b
16/16

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/16] drm/amdgpu: Support VCE1 IP block (v2)

VCE1 is the Video Coding Engine 1.0 found in SI GPUs. Add support for the VCE1 IP block, which is the last missing piece for fully-featured SI support in amdgpu. Co-developed by Alexandre Demers.

This VCE1 implementation is based on:
VCE2 code in amdgpu
VCE1 code in radeon
Research by Alexandre
Suggestions from Christian

The biggest challenge was getting the firmware validation mechanism to work correctly. Due to some limitations in the HW, the VCE1 requires the VCPU BO to be located at a low 32-bit address. This was achieved by placing the GART in the LOW address space and manually mapping the VCPU BO in the GART page table.

Also hook up the VCE1 to the DPM.

Tested on the following HW:
Radeon R9 280X (Tahiti)
Radeon HD 7990 (Tahiti)
FirePro W9000 (Tahiti)
Radeon R7 450 (Cape Verde)

Changes in v2:
- Refactor the new GART helper to be reusable
- Reduce reserved GART size from 16 MiB to 2 MiB
- Clear VCPU BO only on device creation
- Save VCPU BO on suspend, restore on resume
- Rework how an empty codec list is handled
- Add different workaround for FirePro W9000
- Address all other feedback from the review

Looking forward to reviews and feedback!

Timur Kristóf (16):
drm/amdgpu/gmc: Don't hardcode GART page count before GTT drm/amdgpu/gmc6: Place gart at low address range drm/amdgpu/gmc6: Add GART space for VCPU BO (v2) drm/amdgpu/gart: Add helper to bind VRAM pages (v2) drm/amdgpu/ttm: Use GART helper to map VRAM pages (v2) drm/amdgpu/vce: Clear VCPU BO before copying firmware to it (v2) drm/amdgpu/vce: Move firmware load to amdgpu_vce_early_init drm/amdgpu/vce: Save/restore and pin VCPU BO for all VCE (v2) drm/amdgpu/si,cik,vi: Verify IP block when querying video codecs (v2) drm/amdgpu/vce1: Clean up register definitions drm/amdgpu/vce1: Load VCE1 firmware
drm/amdgpu/vce1: Implement VCE1 IP block (v2) drm/amdgpu/vce1: Ensure VCPU BO is in lower 32-bit address space (v2) drm/amd/pm/si: Hook up VCE1 to SI DPM
drm/amdgpu/vce1: Enable VCE1 on Tahiti, Pitcairn, Cape Verde GPUs drm/amdgpu/vce1: Workaround PLL timeout on FirePro W9000

 drivers/gpu/drm/amd/amdgpu/Makefile           |   2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c      |  36 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_gart.h      |   3 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c       |   2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h       |   1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c   |   2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c       |   7 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c       |  12 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c       | 179 ++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h       |   2 +
 drivers/gpu/drm/amd/amdgpu/cik.c              |   6 +
 drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c         |   5 +-
 drivers/gpu/drm/amd/amdgpu/si.c               |  28 +-
 drivers/gpu/drm/amd/amdgpu/sid.h              |  40 -
 drivers/gpu/drm/amd/amdgpu/vce_v1_0.c         | 835 ++++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/vce_v1_0.h         |  32 +
 drivers/gpu/drm/amd/amdgpu/vce_v2_0.c         |   5 +
 drivers/gpu/drm/amd/amdgpu/vce_v3_0.c         |   5 +
 drivers/gpu/drm/amd/amdgpu/vce_v4_0.c         |  57 +-
 drivers/gpu/drm/amd/amdgpu/vi.c               |   6 +
 .../drm/amd/include/asic_reg/vce/vce_1_0_d.h  |   5 +
 .../include/asic_reg/vce/vce_1_0_sh_mask.h    |  10 +
 drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c    |  18 +-
 23 files changed, 1109 insertions(+), 189 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/amdgpu/vce_v1_0.c
 create mode 100644 drivers/gpu/drm/amd/amdgpu/vce_v1_0.h
Signature · 1 line
2.51.0