mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
drm/amdgpu: use a define for the memory size of the vga emulator
Rather than open coding it everywhere. Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
adb5be8122
commit
81b54fb7a2
6 changed files with 8 additions and 6 deletions
|
@ -214,6 +214,8 @@ extern int amdgpu_num_kcq;
|
|||
#define AMDGPUFB_CONN_LIMIT 4
|
||||
#define AMDGPU_BIOS_NUM_SCRATCH 16
|
||||
|
||||
#define AMDGPU_VBIOS_VGA_ALLOCATION (9 * 1024 * 1024) /* reserve 8MB for vga emulator and 1 MB for FB */
|
||||
|
||||
/* hard reset data */
|
||||
#define AMDGPU_ASIC_RESET_DATA 0x39d5e86b
|
||||
|
||||
|
|
|
@ -747,7 +747,7 @@ static unsigned gmc_v10_0_get_vbios_fb_size(struct amdgpu_device *adev)
|
|||
unsigned size;
|
||||
|
||||
if (REG_GET_FIELD(d1vga_control, D1VGA_CONTROL, D1VGA_MODE_ENABLE)) {
|
||||
size = 9 * 1024 * 1024; /* reserve 8MB for vga emulator and 1 MB for FB */
|
||||
size = AMDGPU_VBIOS_VGA_ALLOCATION;
|
||||
} else {
|
||||
u32 viewport;
|
||||
u32 pitch;
|
||||
|
|
|
@ -805,7 +805,7 @@ static unsigned gmc_v6_0_get_vbios_fb_size(struct amdgpu_device *adev)
|
|||
unsigned size;
|
||||
|
||||
if (REG_GET_FIELD(d1vga_control, D1VGA_CONTROL, D1VGA_MODE_ENABLE)) {
|
||||
size = 9 * 1024 * 1024; /* reserve 8MB for vga emulator and 1 MB for FB */
|
||||
size = AMDGPU_VBIOS_VGA_ALLOCATION;
|
||||
} else {
|
||||
u32 viewport = RREG32(mmVIEWPORT_SIZE);
|
||||
size = (REG_GET_FIELD(viewport, VIEWPORT_SIZE, VIEWPORT_HEIGHT) *
|
||||
|
|
|
@ -970,7 +970,7 @@ static unsigned gmc_v7_0_get_vbios_fb_size(struct amdgpu_device *adev)
|
|||
unsigned size;
|
||||
|
||||
if (REG_GET_FIELD(d1vga_control, D1VGA_CONTROL, D1VGA_MODE_ENABLE)) {
|
||||
size = 9 * 1024 * 1024; /* reserve 8MB for vga emulator and 1 MB for FB */
|
||||
size = AMDGPU_VBIOS_VGA_ALLOCATION;
|
||||
} else {
|
||||
u32 viewport = RREG32(mmVIEWPORT_SIZE);
|
||||
size = (REG_GET_FIELD(viewport, VIEWPORT_SIZE, VIEWPORT_HEIGHT) *
|
||||
|
|
|
@ -1087,7 +1087,7 @@ static unsigned gmc_v8_0_get_vbios_fb_size(struct amdgpu_device *adev)
|
|||
unsigned size;
|
||||
|
||||
if (REG_GET_FIELD(d1vga_control, D1VGA_CONTROL, D1VGA_MODE_ENABLE)) {
|
||||
size = 9 * 1024 * 1024; /* reserve 8MB for vga emulator and 1 MB for FB */
|
||||
size = AMDGPU_VBIOS_VGA_ALLOCATION;
|
||||
} else {
|
||||
u32 viewport = RREG32(mmVIEWPORT_SIZE);
|
||||
size = (REG_GET_FIELD(viewport, VIEWPORT_SIZE, VIEWPORT_HEIGHT) *
|
||||
|
|
|
@ -1077,11 +1077,11 @@ static unsigned gmc_v9_0_get_vbios_fb_size(struct amdgpu_device *adev)
|
|||
* Check related code in gmc_v9_0_sw_fini
|
||||
* */
|
||||
if (gmc_v9_0_keep_stolen_memory(adev))
|
||||
return 9 * 1024 * 1024;
|
||||
return AMDGPU_VBIOS_VGA_ALLOCATION;
|
||||
|
||||
d1vga_control = RREG32_SOC15(DCE, 0, mmD1VGA_CONTROL);
|
||||
if (REG_GET_FIELD(d1vga_control, D1VGA_CONTROL, D1VGA_MODE_ENABLE)) {
|
||||
size = 9 * 1024 * 1024; /* reserve 8MB for vga emulator and 1 MB for FB */
|
||||
size = AMDGPU_VBIOS_VGA_ALLOCATION;
|
||||
} else {
|
||||
u32 viewport;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue