[PATCH v2 2/7] drm/ast: Add VGACRAA register constants
Jocelyn Falempe
jfalempe at redhat.com
Tue Mar 11 13:07:13 UTC 2025
On 05/03/2025 17:30, Thomas Zimmermann wrote:
> Add register constants for VGACRAA and use them when detecting the
> size of the VGA memory. Aligns the code with the programming manual.
>
Thanks, it looks good to me.
Reviewed-by: Jocelyn Falempe <jfalempe at redhat.com>
> Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
> ---
> drivers/gpu/drm/ast/ast_mm.c | 5 +++--
> drivers/gpu/drm/ast/ast_reg.h | 1 +
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/ast/ast_mm.c b/drivers/gpu/drm/ast/ast_mm.c
> index 20d833632a01..8d8aac8c0814 100644
> --- a/drivers/gpu/drm/ast/ast_mm.c
> +++ b/drivers/gpu/drm/ast/ast_mm.c
> @@ -37,9 +37,10 @@ static u32 ast_get_vram_size(struct ast_device *ast)
> {
> u8 jreg;
> u32 vram_size;
> + u8 vgacraa;
>
> - jreg = ast_get_index_reg_mask(ast, AST_IO_VGACRI, 0xaa, 0xff);
> - switch (jreg & 3) {
> + vgacraa = ast_get_index_reg(ast, AST_IO_VGACRI, 0xaa);
> + switch (vgacraa & AST_IO_VGACRAA_VGAMEM_SIZE_MASK) {
> case 0:
> vram_size = SZ_8M;
> break;
> diff --git a/drivers/gpu/drm/ast/ast_reg.h b/drivers/gpu/drm/ast/ast_reg.h
> index bb2cc1d8b84e..039b93bed19e 100644
> --- a/drivers/gpu/drm/ast/ast_reg.h
> +++ b/drivers/gpu/drm/ast/ast_reg.h
> @@ -33,6 +33,7 @@
> #define AST_IO_VGACRA1_VGAIO_DISABLED BIT(1)
> #define AST_IO_VGACRA1_MMIO_ENABLED BIT(2)
> #define AST_IO_VGACRA3_DVO_ENABLED BIT(7)
> +#define AST_IO_VGACRAA_VGAMEM_SIZE_MASK GENMASK(1, 0)
> #define AST_IO_VGACRB6_HSYNC_OFF BIT(0)
> #define AST_IO_VGACRB6_VSYNC_OFF BIT(1)
> #define AST_IO_VGACRCB_HWC_16BPP BIT(0) /* set: ARGB4444, cleared: 2bpp palette */
More information about the dri-devel
mailing list