From 1d3d294409dde3d18fc412995a5e13a53489a2d5 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Mon, 5 Dec 2011 12:37:51 +0200 Subject: [PATCH] gfx: display: remove the remains of unused procfs support The gfx driver procfs has not been enabled or used for a while, and parts of it are obsolete and bitrotten. Remove what's left of the procfs support. In the unlikely event that the interface is ever needed in the future, it should be implemented through sysfs anyway. Signed-off-by: Jani Nikula Signed-off-by: Kirill A. Shutemov --- drivers/staging/mrst/drv/psb_drv.c | 289 ------------------------------------- 1 file changed, 289 deletions(-) diff --git a/drivers/staging/mrst/drv/psb_drv.c b/drivers/staging/mrst/drv/psb_drv.c index 3ba31bf..0db802a 100644 --- a/drivers/staging/mrst/drv/psb_drv.c +++ b/drivers/staging/mrst/drv/psb_drv.c @@ -2394,240 +2394,6 @@ static long psb_unlocked_ioctl(struct file *filp, unsigned int cmd, return ret; } -static int psb_blc_proc_show(struct seq_file *seq, void *v) -{ - struct drm_minor *minor = (struct drm_minor *) seq->private; - struct drm_device *dev = minor->dev; - struct drm_psb_private *dev_priv = - (struct drm_psb_private *) dev->dev_private; - int user_brightness = 0; - int final_brightness = 0; - - user_brightness = psb_get_brightness(NULL); - final_brightness = (user_brightness * dev_priv->blc_adj1) / 100; - final_brightness = (final_brightness * dev_priv->blc_adj2) / 100; - - DRM_INFO("%i\n", final_brightness); - seq_printf(seq, "%i\n", final_brightness); - - return 0; -} - -static int psb_blc_proc_open(struct inode *inode, struct file *file) -{ - return single_open(file, psb_blc_proc_show, PDE(inode)->data); -} - -static const struct file_operations psb_blc_proc_fops = { - .owner = THIS_MODULE, - .open = psb_blc_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - -static int psb_rtpm_read(char *buf, char **start, off_t offset, int request, - int *eof, void *data) -{ - printk(KERN_ALERT "Current Runtime PM delay for GFX: %d (ms) \n", gfxrtdelay); - - return 0; -} - -static int psb_rtpm_write(struct file *file, const char *buffer, - unsigned long count, void *data) -{ - char buf[2]; - int temp = 0; - if (count != sizeof(buf)) { - return -EINVAL; - } else { - if (copy_from_user(buf, buffer, count)) - return -EINVAL; - if (buf[count-1] != '\n') - return -EINVAL; - temp = buf[0] - '0'; - switch (temp) { - case 1: - gfxrtdelay = 10 * 1000; - break; - - case 2: - gfxrtdelay = 20 * 1000; - break; - default: - gfxrtdelay = 30 * 1000; - break; - } - printk(KERN_ALERT "Runtime PM delay set for GFX: %d (ms) \n", gfxrtdelay); - } - return count; -} - -static int psb_ospm_read(char *buf, char **start, off_t offset, int request, - int *eof, void *data) -{ - struct drm_minor *minor = (struct drm_minor *) data; - struct drm_device *dev = minor->dev; - struct drm_psb_private *dev_priv = - (struct drm_psb_private *) dev->dev_private; - int len = 0; -#ifdef OSPM_STAT - unsigned long on_time = 0; - unsigned long off_time = 0; -#endif - - *start = &buf[offset]; - *eof = 0; - - /*#ifdef SUPPORT_ACTIVE_POWER_MANAGEMENT - DRM_INFO("GFX D0i3: enabled "); - #else - DRM_INFO("GFX D0i3: disabled "); - #endif*/ - if (drm_psb_ospm) - DRM_INFO("GFX D0i3: enabled "); - else - DRM_INFO("GFX D0i3: disabled "); - -#ifdef OSPM_STAT - switch (dev_priv->graphics_state) { - case PSB_PWR_STATE_ON: - DRM_INFO("GFX state:%s\n", "on"); - break; - case PSB_PWR_STATE_OFF: - DRM_INFO("GFX state:%s\n", "off"); - break; - default: - DRM_INFO("GFX state:%s\n", "unknown"); - } - - on_time = dev_priv->gfx_on_time * 1000 / HZ; - off_time = dev_priv->gfx_off_time * 1000 / HZ; - switch (dev_priv->graphics_state) { - case PSB_PWR_STATE_ON: - on_time += (jiffies - dev_priv->gfx_last_mode_change) * \ - 1000 / HZ; - break; - case PSB_PWR_STATE_OFF: - off_time += (jiffies - dev_priv->gfx_last_mode_change) * \ - 1000 / HZ; - break; - } - DRM_INFO("GFX(count/ms):\n"); - DRM_INFO("on:%lu/%lu, off:%lu/%lu \n", - dev_priv->gfx_on_cnt, on_time, dev_priv->gfx_off_cnt, off_time); -#endif - if (len > request + offset) - return request; - *eof = 1; - return len - offset; -} - - -static int psb_ospm_write(struct file *file, const char *buffer, - unsigned long count, void *data) -{ - char buf[2]; - if (count != sizeof(buf)) { - return -EINVAL; - } else { - if (copy_from_user(buf, buffer, count)) - return -EINVAL; - if (buf[count-1] != '\n') - return -EINVAL; - drm_psb_ospm = buf[0] - '0'; - printk(KERN_ALERT " SGX (D0i3) drm_psb_ospm: %d \n", - drm_psb_ospm); - /*Work around for video encode, it needs sgx always on*/ - if (!drm_psb_ospm) { - ospm_power_using_hw_begin(OSPM_GRAPHICS_ISLAND, true); - ospm_power_using_hw_end(OSPM_GRAPHICS_ISLAND); - } - } - return count; -} - -/* -* use to read and write display register. and print to standard output. -*/ -static int psb_display_register_write(struct file *file, const char *buffer, - unsigned long count, void *data) -{ - struct drm_minor *minor = (struct drm_minor *) data; - struct drm_device *dev = minor->dev; - struct drm_psb_private *dev_priv = - (struct drm_psb_private *) dev->dev_private; - int reg_val = 0; - char buf[255]; - char op = '0'; - int reg = 0; - int val = 0; - int counter = 0; - - memset(buf, '\0', sizeof(buf)); - - if (count > sizeof(buf)) { - printk(KERN_ALERT "The input is too bigger, kernel can not handle.\n"); - return -EINVAL; - } else { - if (copy_from_user(buf, buffer, count)) - return -EINVAL; - if (buf[count-1] != '\n') - return -EINVAL; - printk(KERN_ALERT "input = %s", buf); - } - - sscanf(buf, "%c%x%x", &op, ®, &val); - - if (op != 'r' && op != 'w') { - printk(KERN_ALERT "The input format is not right!\n"); - printk(KERN_ALERT "for exampe: r 70184 10 - where 10 is number of dwords\n"); - printk(KERN_ALERT "for exampe: w 70184 123\n"); - return -EINVAL; - } - if (reg < 0xa000 || reg > 0x720ff) { - printk(KERN_ALERT "the register is out of display controller registers rang.\n"); - return -EINVAL; - } - - if ((reg % 0x4) != 0) { - printk(KERN_ALERT "the register address should aligned to 4 byte.please refrence display controller specification.\n"); - return -EINVAL; - } - - if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, - OSPM_UHB_FORCE_POWER_ON)) { - printk(KERN_ALERT "Display controller can not power on.!\n"); - return -EPERM; - } -#ifndef CONFIG_MDFLD_DSI_DPU - mdfld_dsi_dbi_exit_dsr(dev, MDFLD_DSR_CURSOR_0); //assume cursor move once -#endif - if (op == 'r') { - if (!val) - val = 1; - - for (counter = 0; counter < val; counter++) { - reg_val = REG_READ(reg); - printk(KERN_ALERT "Read :reg=0x%08x , val=0x%08x.\n", reg, reg_val); - reg = reg + 4; - } - } - if (op == 'w') { - reg_val = REG_READ(reg); - printk(KERN_ALERT "Before change:reg=0x%08x , val=0x%08x.\n", reg, reg_val); - - REG_WRITE(reg, val); - - reg_val = ioread32(dev_priv->vdc_reg + (reg)); - printk(KERN_ALERT "After change:reg=0x%08x , val=0x%08x.\n", reg, reg_val); - } - - ospm_power_using_hw_end(OSPM_DISPLAY_ISLAND); - return count; -} - /* When a client dies: * - Check for and clean up flipped page state */ @@ -2641,61 +2407,6 @@ static void psb_remove(struct pci_dev *pdev) drm_put_dev(dev); } -#if 0 -static int psb_proc_init(struct drm_minor *minor) -{ - struct proc_dir_entry *ent; - struct proc_dir_entry *ent1; - struct proc_dir_entry *rtpm; - struct proc_dir_entry *ent_display_status; - - /* register proc entry for ospm */ - ent = create_proc_entry(OSPM_PROC_ENTRY, 0644, minor->proc_root); - if (ent) { - ent->read_proc = psb_ospm_read; - ent->write_proc = psb_ospm_write; - ent->data = (void *)minor; - } else { - printk(KERN_ALERT "GFX: Create Proc Entry for OSPM Failed.\n"); - } - - /* register proc entry for runtime PM */ - rtpm = create_proc_entry(RTPM_PROC_ENTRY, 0644, minor->proc_root); - if (rtpm) { - rtpm->read_proc = psb_rtpm_read; - rtpm->write_proc = psb_rtpm_write; - } else { - printk(KERN_ALERT "GFX: Create Proc Entry for Runtime PM Failed.\n"); - } - - /* register proc entry for display register read/write */ - ent_display_status = create_proc_entry(DISPLAY_PROC_ENTRY, 0644, minor->proc_root); - if (ent_display_status) { - ent_display_status->write_proc = psb_display_register_write; - ent_display_status->data = (void *)minor; - } else { - printk(KERN_ALERT "GFX: Create Proc Entry for Display Status Failed.\n"); - } - - /* register proc data for backlight */ - ent1 = proc_create_data(BLC_PROC_ENTRY, 0, minor->proc_root, &psb_blc_proc_fops, minor); - if (!ent1) { - printk(KERN_ALERT "GFX: Create Proc Data for Backlight Failed.\n"); - } - - return 0; -} - -static void psb_proc_cleanup(struct drm_minor *minor) -{ - remove_proc_entry(OSPM_PROC_ENTRY, minor->proc_root); - remove_proc_entry(RTPM_PROC_ENTRY, minor->proc_root); - remove_proc_entry(BLC_PROC_ENTRY, minor->proc_root); - remove_proc_entry(DISPLAY_PROC_ENTRY, minor->proc_root); - return; -} -#endif - static const struct dev_pm_ops psb_pm_ops = { .runtime_suspend = psb_runtime_suspend, .runtime_resume = psb_runtime_resume, -- 2.7.4