]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/ast: Move mode-detection helpers to Gen2 source files
authorThomas Zimmermann <tzimmermann@suse.de>
Mon, 22 Sep 2025 08:36:02 +0000 (10:36 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 29 Sep 2025 11:28:08 +0000 (13:28 +0200)
Wide-screen modes are only available on Gen2 and later. Move the
detection helpers to the appropriate source file.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250922083708.45564-3-tzimmermann@suse.de
drivers/gpu/drm/ast/ast_2100.c
drivers/gpu/drm/ast/ast_drv.h
drivers/gpu/drm/ast/ast_main.c

index 829e3b8b0d1936875c14e5746832ed9e15acc852..16a279ec835142f0a7ceb8531b1302af3def17ad 100644 (file)
@@ -386,3 +386,34 @@ int ast_2100_post(struct ast_device *ast)
 
        return 0;
 }
+
+/*
+ * Widescreen detection
+ */
+
+/* Try to detect WSXGA+ on Gen2+ */
+bool __ast_2100_detect_wsxga_p(struct ast_device *ast)
+{
+       u8 vgacrd0 = ast_get_index_reg(ast, AST_IO_VGACRI, 0xd0);
+
+       if (!(vgacrd0 & AST_IO_VGACRD0_VRAM_INIT_BY_BMC))
+               return true;
+       if (vgacrd0 & AST_IO_VGACRD0_IKVM_WIDESCREEN)
+               return true;
+
+       return false;
+}
+
+/* Try to detect WUXGA on Gen2+ */
+bool __ast_2100_detect_wuxga(struct ast_device *ast)
+{
+       u8 vgacrd1;
+
+       if (ast->support_fullhd) {
+               vgacrd1 = ast_get_index_reg(ast, AST_IO_VGACRI, 0xd1);
+               if (!(vgacrd1 & AST_IO_VGACRD1_SUPPORTS_WUXGA))
+                       return true;
+       }
+
+       return false;
+}
index 482d1eb79d6406aaf2d986da84850b5ec801cba7..c75600981251d4cd29b38c1f7e45011134841346 100644 (file)
@@ -421,6 +421,8 @@ extern const struct ast_vbios_dclk_info ast_2000_dclk_table[];
 
 /* ast_2100.c */
 int ast_2100_post(struct ast_device *ast);
+bool __ast_2100_detect_wsxga_p(struct ast_device *ast);
+bool __ast_2100_detect_wuxga(struct ast_device *ast);
 
 /* ast_2300.c */
 int ast_2300_post(struct ast_device *ast);
index 3eea6a6cdacdc0c3ec274eae50e8eebd2ed35cdf..1678845274c7016449361c20b6a41ae62643005f 100644 (file)
 
 #include "ast_drv.h"
 
-/* Try to detect WSXGA+ on Gen2+ */
-static bool __ast_2100_detect_wsxga_p(struct ast_device *ast)
-{
-       u8 vgacrd0 = ast_get_index_reg(ast, AST_IO_VGACRI, 0xd0);
-
-       if (!(vgacrd0 & AST_IO_VGACRD0_VRAM_INIT_BY_BMC))
-               return true;
-       if (vgacrd0 & AST_IO_VGACRD0_IKVM_WIDESCREEN)
-               return true;
-
-       return false;
-}
-
-/* Try to detect WUXGA on Gen2+ */
-static bool __ast_2100_detect_wuxga(struct ast_device *ast)
-{
-       u8 vgacrd1;
-
-       if (ast->support_fullhd) {
-               vgacrd1 = ast_get_index_reg(ast, AST_IO_VGACRI, 0xd1);
-               if (!(vgacrd1 & AST_IO_VGACRD1_SUPPORTS_WUXGA))
-                       return true;
-       }
-
-       return false;
-}
-
 static void ast_detect_widescreen(struct ast_device *ast)
 {
        ast->support_wsxga_p = false;