diff options
Diffstat (limited to 'drivers/gpu/drm/armada')
-rw-r--r-- | drivers/gpu/drm/armada/armada_crtc.c | 56 | ||||
-rw-r--r-- | drivers/gpu/drm/armada/armada_crtc.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/armada/armada_debugfs.c | 65 | ||||
-rw-r--r-- | drivers/gpu/drm/armada/armada_drm.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/armada/armada_drv.c | 20 | ||||
-rw-r--r-- | drivers/gpu/drm/armada/armada_fbdev.c | 2 |
6 files changed, 47 insertions, 99 deletions
diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c index e62ee4498ce4..1341e0b9368a 100644 --- a/drivers/gpu/drm/armada/armada_crtc.c +++ b/drivers/gpu/drm/armada/armada_crtc.c @@ -418,6 +418,25 @@ static bool armada_drm_crtc_mode_fixup(struct drm_crtc *crtc, return true; } +/* These are locked by dev->vbl_lock */ +static void armada_drm_crtc_disable_irq(struct armada_crtc *dcrtc, u32 mask) +{ + if (dcrtc->irq_ena & mask) { + dcrtc->irq_ena &= ~mask; + writel(dcrtc->irq_ena, dcrtc->base + LCD_SPU_IRQ_ENA); + } +} + +static void armada_drm_crtc_enable_irq(struct armada_crtc *dcrtc, u32 mask) +{ + if ((dcrtc->irq_ena & mask) != mask) { + dcrtc->irq_ena |= mask; + writel(dcrtc->irq_ena, dcrtc->base + LCD_SPU_IRQ_ENA); + if (readl_relaxed(dcrtc->base + LCD_SPU_IRQ_ISR) & mask) + writel(0, dcrtc->base + LCD_SPU_IRQ_ISR); + } +} + static void armada_drm_crtc_irq(struct armada_crtc *dcrtc, u32 stat) { void __iomem *base = dcrtc->base; @@ -491,25 +510,6 @@ static irqreturn_t armada_drm_irq(int irq, void *arg) return IRQ_NONE; } -/* These are locked by dev->vbl_lock */ -void armada_drm_crtc_disable_irq(struct armada_crtc *dcrtc, u32 mask) -{ - if (dcrtc->irq_ena & mask) { - dcrtc->irq_ena &= ~mask; - writel(dcrtc->irq_ena, dcrtc->base + LCD_SPU_IRQ_ENA); - } -} - -void armada_drm_crtc_enable_irq(struct armada_crtc *dcrtc, u32 mask) -{ - if ((dcrtc->irq_ena & mask) != mask) { - dcrtc->irq_ena |= mask; - writel(dcrtc->irq_ena, dcrtc->base + LCD_SPU_IRQ_ENA); - if (readl_relaxed(dcrtc->base + LCD_SPU_IRQ_ISR) & mask) - writel(0, dcrtc->base + LCD_SPU_IRQ_ISR); - } -} - static uint32_t armada_drm_crtc_calculate_csc(struct armada_crtc *dcrtc) { struct drm_display_mode *adj = &dcrtc->crtc.mode; @@ -1109,6 +1109,22 @@ armada_drm_crtc_set_property(struct drm_crtc *crtc, return 0; } +/* These are called under the vbl_lock. */ +static int armada_drm_crtc_enable_vblank(struct drm_crtc *crtc) +{ + struct armada_crtc *dcrtc = drm_to_armada_crtc(crtc); + + armada_drm_crtc_enable_irq(dcrtc, VSYNC_IRQ_ENA); + return 0; +} + +static void armada_drm_crtc_disable_vblank(struct drm_crtc *crtc) +{ + struct armada_crtc *dcrtc = drm_to_armada_crtc(crtc); + + armada_drm_crtc_disable_irq(dcrtc, VSYNC_IRQ_ENA); +} + static const struct drm_crtc_funcs armada_crtc_funcs = { .cursor_set = armada_drm_crtc_cursor_set, .cursor_move = armada_drm_crtc_cursor_move, @@ -1116,6 +1132,8 @@ static const struct drm_crtc_funcs armada_crtc_funcs = { .set_config = drm_crtc_helper_set_config, .page_flip = armada_drm_crtc_page_flip, .set_property = armada_drm_crtc_set_property, + .enable_vblank = armada_drm_crtc_enable_vblank, + .disable_vblank = armada_drm_crtc_disable_vblank, }; static const struct drm_plane_funcs armada_primary_plane_funcs = { diff --git a/drivers/gpu/drm/armada/armada_crtc.h b/drivers/gpu/drm/armada/armada_crtc.h index b08043e8cc3b..7e8906d3ae26 100644 --- a/drivers/gpu/drm/armada/armada_crtc.h +++ b/drivers/gpu/drm/armada/armada_crtc.h @@ -104,8 +104,6 @@ struct armada_crtc { void armada_drm_crtc_gamma_set(struct drm_crtc *, u16, u16, u16, int); void armada_drm_crtc_gamma_get(struct drm_crtc *, u16 *, u16 *, u16 *, int); -void armada_drm_crtc_disable_irq(struct armada_crtc *, u32); -void armada_drm_crtc_enable_irq(struct armada_crtc *, u32); void armada_drm_crtc_update_regs(struct armada_crtc *, struct armada_regs *); void armada_drm_crtc_plane_disable(struct armada_crtc *dcrtc, diff --git a/drivers/gpu/drm/armada/armada_debugfs.c b/drivers/gpu/drm/armada/armada_debugfs.c index a8020cf9da2e..6758c3a83de2 100644 --- a/drivers/gpu/drm/armada/armada_debugfs.c +++ b/drivers/gpu/drm/armada/armada_debugfs.c @@ -107,40 +107,9 @@ static struct drm_info_list armada_debugfs_list[] = { }; #define ARMADA_DEBUGFS_ENTRIES ARRAY_SIZE(armada_debugfs_list) -static int drm_add_fake_info_node(struct drm_minor *minor, struct dentry *ent, - const void *key) -{ - struct drm_info_node *node; - - node = kmalloc(sizeof(struct drm_info_node), GFP_KERNEL); - if (!node) { - debugfs_remove(ent); - return -ENOMEM; - } - - node->minor = minor; - node->dent = ent; - node->info_ent = (void *) key; - - mutex_lock(&minor->debugfs_lock); - list_add(&node->list, &minor->debugfs_list); - mutex_unlock(&minor->debugfs_lock); - - return 0; -} - -static int armada_debugfs_create(struct dentry *root, struct drm_minor *minor, - const char *name, umode_t mode, const struct file_operations *fops) -{ - struct dentry *de; - - de = debugfs_create_file(name, mode, root, minor->dev, fops); - - return drm_add_fake_info_node(minor, de, fops); -} - int armada_drm_debugfs_init(struct drm_minor *minor) { + struct dentry *de; int ret; ret = drm_debugfs_create_files(armada_debugfs_list, @@ -149,29 +118,15 @@ int armada_drm_debugfs_init(struct drm_minor *minor) if (ret) return ret; - ret = armada_debugfs_create(minor->debugfs_root, minor, - "reg", S_IFREG | S_IRUSR, &fops_reg_r); - if (ret) - goto err_1; + de = debugfs_create_file("reg", S_IFREG | S_IRUSR, + minor->debugfs_root, minor->dev, &fops_reg_r); + if (!de) + return -ENOMEM; - ret = armada_debugfs_create(minor->debugfs_root, minor, - "reg_wr", S_IFREG | S_IWUSR, &fops_reg_w); - if (ret) - goto err_2; - return ret; - - err_2: - drm_debugfs_remove_files((struct drm_info_list *)&fops_reg_r, 1, minor); - err_1: - drm_debugfs_remove_files(armada_debugfs_list, ARMADA_DEBUGFS_ENTRIES, - minor); - return ret; -} + de = debugfs_create_file("reg_wr", S_IFREG | S_IWUSR, + minor->debugfs_root, minor->dev, &fops_reg_w); + if (!de) + return -ENOMEM; -void armada_drm_debugfs_cleanup(struct drm_minor *minor) -{ - drm_debugfs_remove_files((struct drm_info_list *)&fops_reg_w, 1, minor); - drm_debugfs_remove_files((struct drm_info_list *)&fops_reg_r, 1, minor); - drm_debugfs_remove_files(armada_debugfs_list, ARMADA_DEBUGFS_ENTRIES, - minor); + return 0; } diff --git a/drivers/gpu/drm/armada/armada_drm.h b/drivers/gpu/drm/armada/armada_drm.h index 77952d559a3c..b064879ecdbd 100644 --- a/drivers/gpu/drm/armada/armada_drm.h +++ b/drivers/gpu/drm/armada/armada_drm.h @@ -90,6 +90,5 @@ void armada_fbdev_fini(struct drm_device *); int armada_overlay_plane_create(struct drm_device *, unsigned long); int armada_drm_debugfs_init(struct drm_minor *); -void armada_drm_debugfs_cleanup(struct drm_minor *); #endif diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c index b4e5e0529eae..408e00b64cf6 100644 --- a/drivers/gpu/drm/armada/armada_drv.c +++ b/drivers/gpu/drm/armada/armada_drv.c @@ -49,20 +49,6 @@ void armada_drm_queue_unref_work(struct drm_device *dev, spin_unlock_irqrestore(&dev->event_lock, flags); } -/* These are called under the vbl_lock. */ -static int armada_drm_enable_vblank(struct drm_device *dev, unsigned int pipe) -{ - struct armada_private *priv = dev->dev_private; - armada_drm_crtc_enable_irq(priv->dcrtc[pipe], VSYNC_IRQ_ENA); - return 0; -} - -static void armada_drm_disable_vblank(struct drm_device *dev, unsigned int pipe) -{ - struct armada_private *priv = dev->dev_private; - armada_drm_crtc_disable_irq(priv->dcrtc[pipe], VSYNC_IRQ_ENA); -} - static struct drm_ioctl_desc armada_ioctls[] = { DRM_IOCTL_DEF_DRV(ARMADA_GEM_CREATE, armada_gem_create_ioctl,0), DRM_IOCTL_DEF_DRV(ARMADA_GEM_MMAP, armada_gem_mmap_ioctl, 0), @@ -87,9 +73,6 @@ static const struct file_operations armada_drm_fops = { static struct drm_driver armada_drm_driver = { .lastclose = armada_drm_lastclose, - .get_vblank_counter = drm_vblank_no_hw_counter, - .enable_vblank = armada_drm_enable_vblank, - .disable_vblank = armada_drm_disable_vblank, .gem_free_object_unlocked = armada_gem_free_object, .prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle, @@ -225,9 +208,6 @@ static void armada_drm_unbind(struct device *dev) drm_kms_helper_poll_fini(&priv->drm); armada_fbdev_fini(&priv->drm); -#ifdef CONFIG_DEBUG_FS - armada_drm_debugfs_cleanup(priv->drm.primary); -#endif drm_dev_unregister(&priv->drm); component_unbind_all(dev, &priv->drm); diff --git a/drivers/gpu/drm/armada/armada_fbdev.c b/drivers/gpu/drm/armada/armada_fbdev.c index 0233e1dc33e1..602dfead8eef 100644 --- a/drivers/gpu/drm/armada/armada_fbdev.c +++ b/drivers/gpu/drm/armada/armada_fbdev.c @@ -157,7 +157,6 @@ int armada_fbdev_init(struct drm_device *dev) return 0; err_fb_setup: - drm_fb_helper_release_fbi(fbh); drm_fb_helper_fini(fbh); err_fb_helper: priv->fbdev = NULL; @@ -179,7 +178,6 @@ void armada_fbdev_fini(struct drm_device *dev) if (fbh) { drm_fb_helper_unregister_fbi(fbh); - drm_fb_helper_release_fbi(fbh); drm_fb_helper_fini(fbh); |