Port UVD from radeon for SI
Subsystems (2)
cover Port UVD from radeon for SI
Here is my attempt at porting UVD from radeon to amdgpu for SI devices.
First, this in no way works. I started with UVD for CIK and have worked backwards to arrive at this place. I've gone back over most things from radeon and most of it looks correct as far as I can see. It currently loads the UVD firmware but fails the first initial ring test. It was a bit unclear to me how/when CIK calls uvd_4_2_start and I don't have the hardware to test myself on CIK. Radeon was calling uvd_v1_0_start before the ring test but calling uvd_v3_1_start before the ring test results in it failing to start after trying to reset. Any ideas on what could be wrong would be greatly appreciated.
This does require a new firmware file. Since amdgpu expects only firmware files with the header I have added one to the existing TAHITI_uvd.bin. I verified that my header was correct by adding the new firmware to radeon and verified UVD initializes correctly with it. I have uploaded a copy to my google drive if anyone wants it. See link below.
I'm testing on pitcairn device (R9 270X). Any feedback welcome. I don't know if I will be able to do much more since there isn't open any documentation for this besides the radeon but I'll likely keep poking at it a bit longer.
You can find it on my github brance amdgpu-si-uvd.
https://github.com/tdaven/linux-amdgpu
tahiti_uvd.bin (should be places in /lib/firmware/radeon).
https://drive.google.com/file/d/0B9a9RNUDRbKFZU5Hd0VseUhKaGc/view?usp=sharing
Trevor Davenport (1):
drm/amdgpu/uvd3: Initial port of UVD from radeon for SI.
drivers/gpu/drm/amd/amdgpu/Makefile | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 14 + drivers/gpu/drm/amd/amdgpu/si.c | 256 ++++++- drivers/gpu/drm/amd/amdgpu/si_ih.c | 6 + drivers/gpu/drm/amd/amdgpu/sid.h | 45 +- drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c | 832 +++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/uvd_v3_1.h | 29 + .../gpu/drm/amd/include/asic_reg/uvd/uvd_3_1_d.h | 91 +++ .../drm/amd/include/asic_reg/uvd/uvd_3_1_sh_mask.h | 65 ++ 9 files changed, 1290 insertions(+), 51 deletions(-) create mode 100644 drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c create mode 100644 drivers/gpu/drm/amd/amdgpu/uvd_v3_1.h create mode 100644 drivers/gpu/drm/amd/include/asic_reg/uvd/uvd_3_1_d.h create mode 100644 drivers/gpu/drm/amd/include/asic_reg/uvd/uvd_3_1_sh_mask.h
Signature · 6 lines
2.13.5 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20170901153008.22075-1-trevor.davenport-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
PATCH 1/1 drm/amdgpu/uvd3: Initial port of UVD from radeon for SI.
--- drivers/gpu/drm/amd/amdgpu/Makefile | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 14 + drivers/gpu/drm/amd/amdgpu/si.c | 256 ++++++- drivers/gpu/drm/amd/amdgpu/si_ih.c | 6 + drivers/gpu/drm/amd/amdgpu/sid.h | 45 +- drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c | 832 +++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/uvd_v3_1.h | 29 + .../gpu/drm/amd/include/asic_reg/uvd/uvd_3_1_d.h | 91 +++ .../drm/amd/include/asic_reg/uvd/uvd_3_1_sh_mask.h | 65 ++ 9 files changed, 1290 insertions(+), 51 deletions(-) create mode 100644 drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c create mode 100644 drivers/gpu/drm/amd/amdgpu/uvd_v3_1.h create mode 100644 drivers/gpu/drm/amd/include/asic_reg/uvd/uvd_3_1_d.h create mode 100644 drivers/gpu/drm/amd/include/asic_reg/uvd/uvd_3_1_sh_mask.h
drivers/gpu/drm/amd/amdgpu/Makefile +2 -1
@@ -32,7 +32,8 @@ amdgpu-$(CONFIG_DRM_AMDGPU_CIK)+= cik.o cik_ih.o kv_smc.o kv_dpm.o \ ci_smc.o ci_dpm.o dce_v8_0.o gfx_v7_0.o cik_sdma.o uvd_v4_2.o vce_v2_0.o \ amdgpu_amdkfd_gfx_v7.o -amdgpu-$(CONFIG_DRM_AMDGPU_SI)+= si.o gmc_v6_0.o gfx_v6_0.o si_ih.o si_dma.o dce_v6_0.o si_dpm.o si_smc.o +amdgpu-$(CONFIG_DRM_AMDGPU_SI)+= si.o gmc_v6_0.o gfx_v6_0.o uvd_v3_1.o si_ih.o \ + si_dma.o dce_v6_0.o si_dpm.o si_smc.o amdgpu-y += \ vi.o mxgpu_vi.o nbio_v6_1.o soc15.o mxgpu_ai.o nbio_v7_0.o
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +14 -0
@@ -52,6 +52,9 @@#define FW_1_66_16 ((1 << 24) | (66 << 16) | (16 << 8))/* Firmware Names */ +#ifdef CONFIG_DRM_AMDGPU_SI +#define FIRMWARE_TAHITI "radeon/tahiti_uvd.bin" +#endif #ifdef CONFIG_DRM_AMDGPU_CIK #define FIRMWARE_BONAIRE "radeon/bonaire_uvd.bin"#define FIRMWARE_KABINI "radeon/kabini_uvd.bin"
@@ -94,6 +97,9 @@ struct amdgpu_uvd_cs_ctx {unsigned *buf_sizes; }; +#ifdef CONFIG_DRM_AMDGPU_SI +MODULE_FIRMWARE (FIRMWARE_TAHITI ); +#endif #ifdef CONFIG_DRM_AMDGPU_CIK MODULE_FIRMWARE (FIRMWARE_BONAIRE );MODULE_FIRMWARE (FIRMWARE_KABINI );
@@ -126,6 +132,14 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev)INIT_DELAYED_WORK (&adev->uvd.idle_work, amdgpu_uvd_idle_work_handler);switch (adev->asic_type) { +#ifdef CONFIG_DRM_AMDGPU_SI +case CHIP_TAHITI : +case CHIP_PITCAIRN : +case CHIP_VERDE : +case CHIP_OLAND : + fw_name =FIRMWARE_TAHITI ; +break ; +#endif #ifdef CONFIG_DRM_AMDGPU_CIK case CHIP_BONAIRE : fw_name =FIRMWARE_BONAIRE ;
drivers/gpu/drm/amd/amdgpu/si.c +250 -6
294 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/si_ih.c +6 -0
@@ -26,6 +26,12 @@#include "sid.h" #include "si_ih.h" +#include "bif/bif_3_0_d.h" +#include "bif/bif_3_0_sh_mask.h" + +#include "oss/oss_1_0_d.h" +#include "oss/oss_1_0_sh_mask.h" +static void si_ih_set_interrupt_funcs (struct amdgpu_device *adev);static void si_ih_enable_interrupts (struct amdgpu_device *adev)
drivers/gpu/drm/amd/amdgpu/sid.h +1 -44
71 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c new file +832 -0
832 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/uvd_v3_1.h new file +29 -0
@@ -0,0 +1,29 @@ +/* +* Copyright 2014 Advanced Micro Devices, Inc. +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR +* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +*/ + +#ifndef __UVD_V3_1_H__ +#define __UVD_V3_1_H__ + +extern const struct amdgpu_ip_block_version uvd_v3_1_ip_block; + +#endif
drivers/gpu/drm/amd/include/asic_reg/uvd/uvd_3_1_d.h new file +91 -0
91 lines not on this page · raw message
drivers/gpu/drm/amd/include/asic_reg/uvd/uvd_3_1_sh_mask.h new file +65 -0
65 lines not on this page · raw message
Signature · 6 lines
2.13.5 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx