mirror of
https://github.com/torvalds/linux.git
synced 2026-11-09 05:34:02 +01:00
drm/amdgpu: handle LSDMA instance and harvest information from ip discovery
Track discovered LSDMA instances in inst_mask and clear harvested instances when processing the harvest table. Report the harvest state through IP discovery sysfs for LSDMA v7.1.0. Signed-off-by: Le Ma <le.ma@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
7f196a3245
commit
b8cb9a172b
|
|
@ -964,6 +964,9 @@ static void amdgpu_discovery_read_from_harvest_table(struct amdgpu_device *adev,
|
|||
case MMHUB_HWID:
|
||||
adev->mmhub.inst_mask &= ~BIT(inst);
|
||||
break;
|
||||
case LSDMA_HWID:
|
||||
adev->lsdma.inst_mask &= ~BIT(inst);
|
||||
break;
|
||||
#if defined(CONFIG_DRM_AMD_ISP)
|
||||
case ISP_HWID:
|
||||
adev->isp.harvest_config |= ~BIT(inst);
|
||||
|
|
@ -1257,6 +1260,9 @@ static uint8_t amdgpu_discovery_get_harvest_info(struct amdgpu_device *adev,
|
|||
case MMHUB_HWID:
|
||||
harvest = (BIT(inst) & adev->mmhub.inst_mask) == 0;
|
||||
break;
|
||||
case LSDMA_HWID:
|
||||
harvest = (BIT(inst) & adev->lsdma.inst_mask) == 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -1802,6 +1808,7 @@ static int amdgpu_discovery_reg_base_init(struct amdgpu_device *adev)
|
|||
adev->vcn.inst_mask = 0;
|
||||
adev->jpeg.inst_mask = 0;
|
||||
adev->mmhub.inst_mask = 0;
|
||||
adev->lsdma.inst_mask = 0;
|
||||
r = amdgpu_discovery_get_table_info(adev, &info, IP_DISCOVERY);
|
||||
if (r)
|
||||
return r;
|
||||
|
|
@ -1877,6 +1884,15 @@ static int amdgpu_discovery_reg_base_init(struct amdgpu_device *adev)
|
|||
AMDGPU_MAX_MMHUB_INSTANCES);
|
||||
}
|
||||
|
||||
if (le16_to_cpu(ip->hw_id) == LSDMA_HWID) {
|
||||
if (inst < AMDGPU_MAX_LSDMA_INSTANCES)
|
||||
adev->lsdma.inst_mask |= BIT(inst);
|
||||
else
|
||||
dev_err(adev->dev, "Too many LSDMA instances: %d vs %d\n",
|
||||
inst + 1,
|
||||
AMDGPU_MAX_LSDMA_INSTANCES);
|
||||
}
|
||||
|
||||
if (le16_to_cpu(ip->hw_id) == SDMA0_HWID ||
|
||||
le16_to_cpu(ip->hw_id) == SDMA1_HWID ||
|
||||
le16_to_cpu(ip->hw_id) == SDMA2_HWID ||
|
||||
|
|
|
|||
|
|
@ -24,9 +24,12 @@
|
|||
#ifndef __AMDGPU_LSDMA_H__
|
||||
#define __AMDGPU_LSDMA_H__
|
||||
|
||||
#define AMDGPU_MAX_LSDMA_INSTANCES 2
|
||||
|
||||
struct amdgpu_lsdma {
|
||||
struct mutex lock;
|
||||
const struct amdgpu_lsdma_funcs *funcs;
|
||||
uint32_t inst_mask;
|
||||
};
|
||||
|
||||
struct amdgpu_lsdma_funcs {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user