diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2015-09-08 01:01:14 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2015-09-08 01:01:14 -0300 |
commit | e5fd91f1ef340da553f7a79da9540c3db711c937 (patch) | |
tree | b11842027dc6641da63f4bcc524f8678263304a3 /drivers/staging/sm750fb/sm750.c | |
parent | 2a9b0348e685a63d97486f6749622b61e9e3292f (diff) |
Linux-libre 4.2-gnu
Diffstat (limited to 'drivers/staging/sm750fb/sm750.c')
-rw-r--r-- | drivers/staging/sm750fb/sm750.c | 62 |
1 files changed, 17 insertions, 45 deletions
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index dbbb2f879..8e201f19c 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -16,9 +16,6 @@ #include<linux/vmalloc.h> #include<linux/pagemap.h> #include <linux/console.h> -#ifdef CONFIG_MTRR -#include <asm/mtrr.h> -#endif #include <asm/fb.h> #include "sm750.h" #include "sm750_hw.h" @@ -47,9 +44,7 @@ typedef int (*PROC_SPEC_INITHW)(struct lynx_share*, struct pci_dev*); /* common var for all device */ static int g_hwcursor = 1; static int g_noaccel; -#ifdef CONFIG_MTRR static int g_nomtrr; -#endif static const char *g_fbmode[] = {NULL, NULL}; static const char *g_def_fbmode = "800x600-16@60"; static char *g_settings = NULL; @@ -93,9 +88,6 @@ static const struct fb_videomode lynx750_ext[] = { FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED}, - {NULL, 60, 1360, 768, 11804, 208, 64, 23, 1, 144, 3, - FB_SYNC_HOR_HIGH_ACT|FB_VMODE_NONINTERLACED}, - /* 1360 x 768 [1.77083:1] */ {NULL, 60, 1360, 768, 11804, 208, 64, 23, 1, 144, 3, FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, @@ -207,7 +199,7 @@ static void lynxfb_ops_fillrect(struct fb_info *info, /* * If not use spin_lock,system will die if user load driver - * and immediatly unload driver frequently (dual) + * and immediately unload driver frequently (dual) */ if (share->dual) spin_lock(&share->slock); @@ -239,7 +231,7 @@ static void lynxfb_ops_copyarea(struct fb_info *info, /* * If not use spin_lock, system will die if user load driver - * and immediatly unload driver frequently (dual) + * and immediately unload driver frequently (dual) */ if (share->dual) spin_lock(&share->slock); @@ -279,11 +271,14 @@ static void lynxfb_ops_imageblit(struct fb_info *info, } goto _do_work; } + /* TODO: Implement hardware acceleration for image->depth > 1 */ + cfb_imageblit(info, image); return; + _do_work: /* * If not use spin_lock, system will die if user load driver - * and immediatly unload driver frequently (dual) + * and immediately unload driver frequently (dual) */ if (share->dual) spin_lock(&share->slock); @@ -343,7 +338,7 @@ static int lynxfb_ops_set_par(struct fb_info *info) line_length = var->xres_virtual * var->bits_per_pixel / 8; line_length = PADDING(crtc->line_pad, line_length); fix->line_length = line_length; - pr_err("fix->line_length = %d\n", fix->line_length); + pr_info("fix->line_length = %d\n", fix->line_length); /* var->red,green,blue,transp are need to be set by driver * and these data should be set before setcolreg routine @@ -479,7 +474,7 @@ static int lynxfb_resume(struct pci_dev *pdev) ret = pci_set_power_state(pdev, PCI_D0); if (ret) { - pr_err("error:%d occured in pci_set_power_state\n", ret); + pr_err("error:%d occurred in pci_set_power_state\n", ret); return ret; } @@ -488,7 +483,7 @@ static int lynxfb_resume(struct pci_dev *pdev) pci_restore_state(pdev); ret = pci_enable_device(pdev); if (ret) { - pr_err("error:%d occured in pci_enable_device\n", ret); + pr_err("error:%d occurred in pci_enable_device\n", ret); return ret; } pci_set_master(pdev); @@ -979,7 +974,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index) ret = fb_alloc_cmap(&info->cmap, 256, 0); if (ret < 0) { - pr_err("Could not allcate memory for cmap.\n"); + pr_err("Could not allocate memory for cmap.\n"); goto exit; } @@ -1026,8 +1021,8 @@ static void sm750fb_setup(struct lynx_share *share, char *src) } while ((opt = strsep(&src, ":")) != NULL && *opt != 0) { - pr_err("opt=%s\n", opt); - pr_err("src=%s\n", src); + pr_info("opt=%s\n", opt); + pr_info("src=%s\n", src); if (!strncmp(opt, "swap", strlen("swap"))) swap = 1; @@ -1092,7 +1087,7 @@ NO_PARAM: } static int lynxfb_pci_probe(struct pci_dev *pdev, - const struct pci_device_id * ent) + const struct pci_device_id *ent) { struct fb_info *info[] = {NULL, NULL}; struct lynx_share *share = NULL; @@ -1126,11 +1121,8 @@ static int lynxfb_pci_probe(struct pci_dev *pdev, pr_info("share->revid = %02x\n", share->revid); share->pdev = pdev; -#ifdef CONFIG_MTRR share->mtrr_off = g_nomtrr; share->mtrr.vram = 0; - share->mtrr.vram_added = 0; -#endif share->accel_off = g_noaccel; share->dual = g_dualview; spin_lock_init(&share->slock); @@ -1158,22 +1150,9 @@ static int lynxfb_pci_probe(struct pci_dev *pdev, goto err_map; } -#ifdef CONFIG_MTRR - if (!share->mtrr_off) { - pr_info("enable mtrr\n"); - share->mtrr.vram = mtrr_add(share->vidmem_start, - share->vidmem_size, - MTRR_TYPE_WRCOMB, 1); - - if (share->mtrr.vram < 0) { - /* don't block driver with the failure of MTRR */ - pr_err("Unable to setup MTRR.\n"); - } else { - share->mtrr.vram_added = 1; - pr_info("MTRR added succesfully\n"); - } - } -#endif + if (!share->mtrr_off) + share->mtrr.vram = arch_phys_wc_add(share->vidmem_start, + share->vidmem_size); memset_io(share->pvMem, 0, share->vidmem_size); @@ -1274,12 +1253,7 @@ static void lynxfb_pci_remove(struct pci_dev *pdev) /* release frame buffer */ framebuffer_release(info); } -#ifdef CONFIG_MTRR - if (share->mtrr.vram_added) - mtrr_del(share->mtrr.vram, - share->vidmem_start, - share->vidmem_size); -#endif + arch_phys_wc_del(share->mtrr.vram); iounmap(share->pvReg); iounmap(share->pvMem); @@ -1321,10 +1295,8 @@ static int __init lynxfb_setup(char *options) /* options that mean for any lynx chips are configured here */ if (!strncmp(opt, "noaccel", strlen("noaccel"))) g_noaccel = 1; -#ifdef CONFIG_MTRR else if (!strncmp(opt, "nomtrr", strlen("nomtrr"))) g_nomtrr = 1; -#endif else if (!strncmp(opt, "dual", strlen("dual"))) g_dualview = 1; else { |