drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c- Extension
.c- Size
- 45974 bytes
- Lines
- 1694
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/firmware.hamdgpu.hamdgpu_uvd.hvid.huvd/uvd_6_0_d.huvd/uvd_6_0_sh_mask.hoss/oss_2_0_d.hoss/oss_2_0_sh_mask.hsmu/smu_7_1_3_d.hsmu/smu_7_1_3_sh_mask.hbif/bif_5_1_d.hgmc/gmc_8_1_d.hvi.hivsrcid/ivsrcid_vislands30.h
Detected Declarations
function uvd_v6_0_enc_supportfunction uvd_v6_0_ring_get_rptrfunction uvd_v6_0_enc_ring_get_rptrfunction uvd_v6_0_ring_get_wptrfunction uvd_v6_0_enc_ring_get_wptrfunction uvd_v6_0_ring_set_wptrfunction uvd_v6_0_enc_ring_set_wptrfunction uvd_v6_0_enc_ring_test_ringfunction uvd_v6_0_enc_get_create_msgfunction uvd_v6_0_enc_get_destroy_msgfunction uvd_v6_0_enc_ring_test_ibfunction uvd_v6_0_early_initfunction uvd_v6_0_sw_initfunction uvd_v6_0_sw_finifunction uvd_v6_0_hw_initfunction uvd_v6_0_hw_finifunction uvd_v6_0_prepare_suspendfunction uvd_v6_0_suspendfunction uvd_v6_0_resumefunction uvd_v6_0_mc_resumefunction cz_set_uvd_clock_gating_branchesfunction uvd_v6_0_startfunction uvd_v6_0_stopfunction uvd_v6_0_ring_emit_fencefunction uvd_v6_0_enc_ring_emit_fencefunction uvd_v6_0_ring_emit_hdp_flushfunction uvd_v6_0_ring_emit_ibfunction uvd_v6_0_enc_ring_emit_ibfunction uvd_v6_0_ring_emit_wregfunction uvd_v6_0_ring_emit_vm_flushfunction uvd_v6_0_ring_emit_pipeline_syncfunction uvd_v6_0_ring_insert_nopfunction uvd_v6_0_enc_ring_emit_pipeline_syncfunction uvd_v6_0_enc_ring_insert_endfunction uvd_v6_0_enc_ring_emit_vm_flushfunction uvd_v6_0_is_idlefunction uvd_v6_0_wait_for_idlefunction uvd_v6_0_check_soft_resetfunction uvd_v6_0_pre_soft_resetfunction uvd_v6_0_soft_resetfunction uvd_v6_0_post_soft_resetfunction uvd_v6_0_set_interrupt_statefunction uvd_v6_0_process_interruptfunction uvd_v6_0_enable_clock_gatingfunction uvd_v6_0_set_sw_clock_gatingfunction uvd_v6_0_set_hw_clock_gatingfunction uvd_v6_0_enable_mgcgfunction uvd_v6_0_set_clockgating_state
Annotated Snippet
#include <linux/firmware.h>
#include "amdgpu.h"
#include "amdgpu_uvd.h"
#include "vid.h"
#include "uvd/uvd_6_0_d.h"
#include "uvd/uvd_6_0_sh_mask.h"
#include "oss/oss_2_0_d.h"
#include "oss/oss_2_0_sh_mask.h"
#include "smu/smu_7_1_3_d.h"
#include "smu/smu_7_1_3_sh_mask.h"
#include "bif/bif_5_1_d.h"
#include "gmc/gmc_8_1_d.h"
#include "vi.h"
#include "ivsrcid/ivsrcid_vislands30.h"
/* Polaris10/11/12 firmware version */
#define FW_1_130_16 ((1 << 24) | (130 << 16) | (16 << 8))
static void uvd_v6_0_set_ring_funcs(struct amdgpu_device *adev);
static void uvd_v6_0_set_enc_ring_funcs(struct amdgpu_device *adev);
static void uvd_v6_0_set_irq_funcs(struct amdgpu_device *adev);
static int uvd_v6_0_start(struct amdgpu_device *adev);
static void uvd_v6_0_stop(struct amdgpu_device *adev);
static void uvd_v6_0_set_sw_clock_gating(struct amdgpu_device *adev);
static int uvd_v6_0_set_clockgating_state(struct amdgpu_ip_block *ip_block,
enum amd_clockgating_state state);
static void uvd_v6_0_enable_mgcg(struct amdgpu_device *adev,
bool enable);
/**
* uvd_v6_0_enc_support - get encode support status
*
* @adev: amdgpu_device pointer
*
* Returns the current hardware encode support status
*/
static inline bool uvd_v6_0_enc_support(struct amdgpu_device *adev)
{
return ((adev->asic_type >= CHIP_POLARIS10) &&
(adev->asic_type <= CHIP_VEGAM) &&
(!adev->uvd.fw_version || adev->uvd.fw_version >= FW_1_130_16));
}
/**
* uvd_v6_0_ring_get_rptr - get read pointer
*
* @ring: amdgpu_ring pointer
*
* Returns the current hardware read pointer
*/
static uint64_t uvd_v6_0_ring_get_rptr(struct amdgpu_ring *ring)
{
struct amdgpu_device *adev = ring->adev;
return RREG32(mmUVD_RBC_RB_RPTR);
}
/**
* uvd_v6_0_enc_ring_get_rptr - get enc read pointer
*
* @ring: amdgpu_ring pointer
*
* Returns the current hardware enc read pointer
*/
static uint64_t uvd_v6_0_enc_ring_get_rptr(struct amdgpu_ring *ring)
{
struct amdgpu_device *adev = ring->adev;
if (ring == &adev->uvd.inst->ring_enc[0])
return RREG32(mmUVD_RB_RPTR);
else
return RREG32(mmUVD_RB_RPTR2);
}
/**
* uvd_v6_0_ring_get_wptr - get write pointer
*
* @ring: amdgpu_ring pointer
*
* Returns the current hardware write pointer
*/
static uint64_t uvd_v6_0_ring_get_wptr(struct amdgpu_ring *ring)
{
struct amdgpu_device *adev = ring->adev;
return RREG32(mmUVD_RBC_RB_WPTR);
}
/**
Annotation
- Immediate include surface: `linux/firmware.h`, `amdgpu.h`, `amdgpu_uvd.h`, `vid.h`, `uvd/uvd_6_0_d.h`, `uvd/uvd_6_0_sh_mask.h`, `oss/oss_2_0_d.h`, `oss/oss_2_0_sh_mask.h`.
- Detected declarations: `function uvd_v6_0_enc_support`, `function uvd_v6_0_ring_get_rptr`, `function uvd_v6_0_enc_ring_get_rptr`, `function uvd_v6_0_ring_get_wptr`, `function uvd_v6_0_enc_ring_get_wptr`, `function uvd_v6_0_ring_set_wptr`, `function uvd_v6_0_enc_ring_set_wptr`, `function uvd_v6_0_enc_ring_test_ring`, `function uvd_v6_0_enc_get_create_msg`, `function uvd_v6_0_enc_get_destroy_msg`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.