Skip to content

Commit 6851829

Browse files
committed
drm/amdgpu/gmc11: implement get_vbios_fb_size()
Implement get_vbios_fb_size() so we can properly reserve the vbios splash screen to avoid potential artifacts on the screen during the transition from the pre-OS console to the OS console. Acked-by: Sunil Khatri <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected] # 6.1.x
1 parent 9d2d182 commit 6851829

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#include "umc_v8_10.h"
3232
#include "athub/athub_3_0_0_sh_mask.h"
3333
#include "athub/athub_3_0_0_offset.h"
34+
#include "dcn/dcn_3_2_0_offset.h"
35+
#include "dcn/dcn_3_2_0_sh_mask.h"
3436
#include "oss/osssys_6_0_0_offset.h"
3537
#include "ivsrcid/vmc/irqsrcs_vmc_1_0.h"
3638
#include "navi10_enum.h"
@@ -546,7 +548,24 @@ static void gmc_v11_0_get_vm_pte(struct amdgpu_device *adev,
546548

547549
static unsigned gmc_v11_0_get_vbios_fb_size(struct amdgpu_device *adev)
548550
{
549-
return 0;
551+
u32 d1vga_control = RREG32_SOC15(DCE, 0, regD1VGA_CONTROL);
552+
unsigned size;
553+
554+
if (REG_GET_FIELD(d1vga_control, D1VGA_CONTROL, D1VGA_MODE_ENABLE)) {
555+
size = AMDGPU_VBIOS_VGA_ALLOCATION;
556+
} else {
557+
u32 viewport;
558+
u32 pitch;
559+
560+
viewport = RREG32_SOC15(DCE, 0, regHUBP0_DCSURF_PRI_VIEWPORT_DIMENSION);
561+
pitch = RREG32_SOC15(DCE, 0, regHUBPREQ0_DCSURF_SURFACE_PITCH);
562+
size = (REG_GET_FIELD(viewport,
563+
HUBP0_DCSURF_PRI_VIEWPORT_DIMENSION, PRI_VIEWPORT_HEIGHT) *
564+
REG_GET_FIELD(pitch, HUBPREQ0_DCSURF_SURFACE_PITCH, PITCH) *
565+
4);
566+
}
567+
568+
return size;
550569
}
551570

552571
static const struct amdgpu_gmc_funcs gmc_v11_0_gmc_funcs = {

0 commit comments

Comments
 (0)