]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
drm/ast: Remove unused code paths for AST 1180
authorThomas Zimmermann <tzimmermann@suse.de>
Wed, 17 Jun 2020 08:03:37 +0000 (10:03 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 22 Jun 2020 11:38:32 +0000 (13:38 +0200)
The ast driver contains code paths for AST 1180 chips. The chip is not
supported and the rsp code has never been tested. Simplify the driver by
removing the AST 1180 code.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200617080340.29584-2-tzimmermann@suse.de
drivers/gpu/drm/ast/ast_drv.c
drivers/gpu/drm/ast/ast_drv.h
drivers/gpu/drm/ast/ast_main.c
drivers/gpu/drm/ast/ast_mode.c
drivers/gpu/drm/ast/ast_post.c

index 48a9cc4e080acb94b14ecdcb7c4eb40e5a79e5d6..f7a14e4e1df0290fc676d95369429ca0fc17b5f9 100644 (file)
@@ -59,7 +59,6 @@ static struct drm_driver driver;
 static const struct pci_device_id pciidlist[] = {
        AST_VGA_DEVICE(PCI_CHIP_AST2000, NULL),
        AST_VGA_DEVICE(PCI_CHIP_AST2100, NULL),
-       /*      AST_VGA_DEVICE(PCI_CHIP_AST1180, NULL), - don't bind to 1180 for now */
        {0, 0, 0},
 };
 
index 656d591b154b320b2884c16c3c7ff6c8e32d4f39..09f2659e29118c7f5572fd7074a77395999c9bde 100644 (file)
@@ -52,7 +52,6 @@
 
 #define PCI_CHIP_AST2000 0x2000
 #define PCI_CHIP_AST2100 0x2010
-#define PCI_CHIP_AST1180 0x1180
 
 
 enum ast_chip {
@@ -64,7 +63,6 @@ enum ast_chip {
        AST2300,
        AST2400,
        AST2500,
-       AST1180,
 };
 
 enum ast_tx_chip {
index 1b35728ad871f379b5341315c28983f0c439ef34..3e64e7c8d325eb634d88930bbfc2842cc8d9f704 100644 (file)
@@ -142,50 +142,42 @@ static int ast_detect_chip(struct drm_device *dev, bool *need_post)
        ast_detect_config_mode(dev, &scu_rev);
 
        /* Identify chipset */
-       if (dev->pdev->device == PCI_CHIP_AST1180) {
-               ast->chip = AST1100;
-               DRM_INFO("AST 1180 detected\n");
-       } else {
-               if (dev->pdev->revision >= 0x40) {
-                       ast->chip = AST2500;
-                       DRM_INFO("AST 2500 detected\n");
-               } else if (dev->pdev->revision >= 0x30) {
-                       ast->chip = AST2400;
-                       DRM_INFO("AST 2400 detected\n");
-               } else if (dev->pdev->revision >= 0x20) {
-                       ast->chip = AST2300;
-                       DRM_INFO("AST 2300 detected\n");
-               } else if (dev->pdev->revision >= 0x10) {
-                       switch (scu_rev & 0x0300) {
-                       case 0x0200:
-                               ast->chip = AST1100;
-                               DRM_INFO("AST 1100 detected\n");
-                               break;
-                       case 0x0100:
-                               ast->chip = AST2200;
-                               DRM_INFO("AST 2200 detected\n");
-                               break;
-                       case 0x0000:
-                               ast->chip = AST2150;
-                               DRM_INFO("AST 2150 detected\n");
-                               break;
-                       default:
-                               ast->chip = AST2100;
-                               DRM_INFO("AST 2100 detected\n");
-                               break;
-                       }
-                       ast->vga2_clone = false;
-               } else {
-                       ast->chip = AST2000;
-                       DRM_INFO("AST 2000 detected\n");
+       if (dev->pdev->revision >= 0x40) {
+               ast->chip = AST2500;
+               DRM_INFO("AST 2500 detected\n");
+       } else if (dev->pdev->revision >= 0x30) {
+               ast->chip = AST2400;
+               DRM_INFO("AST 2400 detected\n");
+       } else if (dev->pdev->revision >= 0x20) {
+               ast->chip = AST2300;
+               DRM_INFO("AST 2300 detected\n");
+       } else if (dev->pdev->revision >= 0x10) {
+               switch (scu_rev & 0x0300) {
+               case 0x0200:
+                       ast->chip = AST1100;
+                       DRM_INFO("AST 1100 detected\n");
+                       break;
+               case 0x0100:
+                       ast->chip = AST2200;
+                       DRM_INFO("AST 2200 detected\n");
+                       break;
+               case 0x0000:
+                       ast->chip = AST2150;
+                       DRM_INFO("AST 2150 detected\n");
+                       break;
+               default:
+                       ast->chip = AST2100;
+                       DRM_INFO("AST 2100 detected\n");
+                       break;
                }
+               ast->vga2_clone = false;
+       } else {
+               ast->chip = AST2000;
+               DRM_INFO("AST 2000 detected\n");
        }
 
        /* Check if we support wide screen */
        switch (ast->chip) {
-       case AST1180:
-               ast->support_wide_screen = true;
-               break;
        case AST2000:
                ast->support_wide_screen = false;
                break;
@@ -469,15 +461,13 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags)
        if (need_post)
                ast_post_gpu(dev);
 
-       if (ast->chip != AST1180) {
-               ret = ast_get_dram_info(dev);
-               if (ret)
-                       goto out_free;
-               ast->vram_size = ast_get_vram_info(dev);
-               DRM_INFO("dram MCLK=%u Mhz type=%d bus_width=%d size=%08x\n",
-                        ast->mclk, ast->dram_type,
-                        ast->dram_bus_width, ast->vram_size);
-       }
+       ret = ast_get_dram_info(dev);
+       if (ret)
+               goto out_free;
+       ast->vram_size = ast_get_vram_info(dev);
+       DRM_INFO("dram MCLK=%u Mhz type=%d bus_width=%d size=%08x\n",
+                ast->mclk, ast->dram_type,
+                ast->dram_bus_width, ast->vram_size);
 
        ret = ast_mm_init(ast);
        if (ret)
@@ -496,8 +486,7 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags)
            ast->chip == AST2200 ||
            ast->chip == AST2300 ||
            ast->chip == AST2400 ||
-           ast->chip == AST2500 ||
-           ast->chip == AST1180) {
+           ast->chip == AST2500) {
                dev->mode_config.max_width = 1920;
                dev->mode_config.max_height = 2048;
        } else {
index 7d39b858c9f1fbbfe68b6d2f0ad353f46b9ed99a..be0e2250708fa6c08b192e9ab9224025cba7ec3e 100644 (file)
@@ -768,9 +768,6 @@ static void ast_crtc_dpms(struct drm_crtc *crtc, int mode)
 {
        struct ast_private *ast = crtc->dev->dev_private;
 
-       if (ast->chip == AST1180)
-               return;
-
        /* TODO: Maybe control display signal generation with
         *       Sync Enable (bit CR17.7).
         */
@@ -797,11 +794,6 @@ static int ast_crtc_helper_atomic_check(struct drm_crtc *crtc,
        const struct drm_format_info *format;
        bool succ;
 
-       if (ast->chip == AST1180) {
-               DRM_ERROR("AST 1180 modesetting not supported\n");
-               return -EINVAL;
-       }
-
        if (!state->enable)
                return 0; /* no mode checks if CRTC is being disabled */
 
@@ -1043,7 +1035,7 @@ static enum drm_mode_status ast_mode_valid(struct drm_connector *connector,
 
                if ((ast->chip == AST2100) || (ast->chip == AST2200) ||
                    (ast->chip == AST2300) || (ast->chip == AST2400) ||
-                   (ast->chip == AST2500) || (ast->chip == AST1180)) {
+                   (ast->chip == AST2500)) {
                        if ((mode->hdisplay == 1920) && (mode->vdisplay == 1080))
                                return MODE_OK;
 
index 2d1b186197432ea42be84d55e0472dde950ef6cf..af0c8ebb009a141bf59969d5bbd038b62852aa5c 100644 (file)
@@ -58,13 +58,9 @@ bool ast_is_vga_enabled(struct drm_device *dev)
        struct ast_private *ast = dev->dev_private;
        u8 ch;
 
-       if (ast->chip == AST1180) {
-               /* TODO 1180 */
-       } else {
-               ch = ast_io_read8(ast, AST_IO_VGA_ENABLE_PORT);
-               return !!(ch & 0x01);
-       }
-       return false;
+       ch = ast_io_read8(ast, AST_IO_VGA_ENABLE_PORT);
+
+       return !!(ch & 0x01);
 }
 
 static const u8 extreginfo[] = { 0x0f, 0x04, 0x1c, 0xff };