* [PATCH 2/5] [resend 2] gxt4500: fix 16bpp 565 mode
From: Ondrej Zary @ 2015-03-22 19:59 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linux-fbdev, Kernel development list
In-Reply-To: <1427054384-26501-1-git-send-email-linux@rainbow-software.org>
Fix wrong colors in 16bpp 565 mode.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
---
drivers/video/fbdev/gxt4500.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/gxt4500.c b/drivers/video/fbdev/gxt4500.c
index 1bf9894..1f2fd5b 100644
--- a/drivers/video/fbdev/gxt4500.c
+++ b/drivers/video/fbdev/gxt4500.c
@@ -525,7 +525,7 @@ static int gxt4500_setcolreg(unsigned int reg, unsigned int red,
u32 val = reg;
switch (par->pixfmt) {
case DFA_PIX_16BIT_565:
- val |= (reg << 11) | (reg << 6);
+ val |= (reg << 11) | (reg << 5);
break;
case DFA_PIX_16BIT_1555:
val |= (reg << 10) | (reg << 5);
--
Ondrej Zary
^ permalink raw reply related
* [PATCH 3/5] [resend 2] gxt4500: fix color order
From: Ondrej Zary @ 2015-03-22 19:59 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linux-fbdev, Kernel development list
In-Reply-To: <1427054384-26501-1-git-send-email-linux@rainbow-software.org>
The color order in truecolor modes is wrong. This does not affect console but
is visible e.g. in X11 which has wrong colors.
Swap blue and red colors to fix the problem.
Fixes https://forums.gentoo.org/viewtopic-t-692740-start-0.html
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
---
drivers/video/fbdev/gxt4500.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/video/fbdev/gxt4500.c b/drivers/video/fbdev/gxt4500.c
index 1f2fd5b..442b07c 100644
--- a/drivers/video/fbdev/gxt4500.c
+++ b/drivers/video/fbdev/gxt4500.c
@@ -347,11 +347,12 @@ static void gxt4500_unpack_pixfmt(struct fb_var_screeninfo *var,
break;
}
if (pixfmt != DFA_PIX_8BIT) {
- var->green.offset = var->red.length;
- var->blue.offset = var->green.offset + var->green.length;
+ var->blue.offset = 0;
+ var->green.offset = var->blue.length;
+ var->red.offset = var->green.offset + var->green.length;
if (var->transp.length)
var->transp.offset - var->blue.offset + var->blue.length;
+ var->red.offset + var->red.length;
}
}
--
Ondrej Zary
^ permalink raw reply related
* [PATCH 4/5] [resend 2] gxt4500: Use write-combining for framebuffer (PAT and MTRR)
From: Ondrej Zary @ 2015-03-22 19:59 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linux-fbdev, Kernel development list
In-Reply-To: <1427054384-26501-1-git-send-email-linux@rainbow-software.org>
Use write-combining for framebuffer to greatly improve performance on x86.
Add both ioremap_wc (for systems with PAT) and MTRR setup for non-PAT systems.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
---
drivers/video/fbdev/gxt4500.c | 32 ++++++++++++++++++++++++++++++--
1 file changed, 30 insertions(+), 2 deletions(-)
diff --git a/drivers/video/fbdev/gxt4500.c b/drivers/video/fbdev/gxt4500.c
index 442b07c..f278c82 100644
--- a/drivers/video/fbdev/gxt4500.c
+++ b/drivers/video/fbdev/gxt4500.c
@@ -13,6 +13,9 @@
#include <linux/pci_ids.h>
#include <linux/delay.h>
#include <linux/string.h>
+#ifdef CONFIG_MTRR
+#include <asm/mtrr.h>
+#endif
#define PCI_DEVICE_ID_IBM_GXT4500P 0x21c
#define PCI_DEVICE_ID_IBM_GXT6500P 0x21b
@@ -142,7 +145,9 @@ static const unsigned char watfmt[] = {
struct gxt4500_par {
void __iomem *regs;
-
+#ifdef CONFIG_MTRR
+ int mtrr_reg;
+#endif
int pixfmt; /* pixel format, see DFA_PIX_* values */
/* PLL parameters */
@@ -158,6 +163,10 @@ struct gxt4500_par {
/* mode requested by user */
static char *mode_option;
+#ifdef CONFIG_MTRR
+static int mtrr = 1;
+#endif
+
/* default mode: 1280x1024 @ 60 Hz, 8 bpp */
static const struct fb_videomode defaultmode = {
.refresh = 60,
@@ -663,7 +672,7 @@ static int gxt4500_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
info->fix.smem_start = fb_phys;
info->fix.smem_len = pci_resource_len(pdev, 1);
- info->screen_base = pci_ioremap_bar(pdev, 1);
+ info->screen_base = ioremap_wc(fb_phys, info->fix.smem_len);
if (!info->screen_base) {
dev_err(&pdev->dev, "gxt4500: cannot map framebuffer\n");
goto err_unmap_regs;
@@ -671,6 +680,14 @@ static int gxt4500_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_set_drvdata(pdev, info);
+#ifdef CONFIG_MTRR
+ if (mtrr) {
+ par->mtrr_reg = -1;
+ par->mtrr_reg = mtrr_add(info->fix.smem_start,
+ info->fix.smem_len, MTRR_TYPE_WRCOMB, 1);
+ }
+#endif
+
#ifdef __BIG_ENDIAN
/* Set byte-swapping for DFA aperture for all pixel sizes */
pci_write_config_dword(pdev, CFG_ENDIAN0, 0x333300);
@@ -735,6 +752,12 @@ static void gxt4500_remove(struct pci_dev *pdev)
return;
par = info->par;
unregister_framebuffer(info);
+#ifdef CONFIG_MTRR
+ if (par->mtrr_reg >= 0) {
+ mtrr_del(par->mtrr_reg, 0, 0);
+ par->mtrr_reg = -1;
+ }
+#endif
fb_dealloc_cmap(&info->cmap);
iounmap(par->regs);
iounmap(info->screen_base);
@@ -789,3 +812,8 @@ MODULE_DESCRIPTION("FBDev driver for IBM GXT4500P/6500P and GXT4000P/6000P");
MODULE_LICENSE("GPL");
module_param(mode_option, charp, 0);
MODULE_PARM_DESC(mode_option, "Specify resolution as \"<xres>x<yres>[-<bpp>][@<refresh>]\"");
+
+#ifdef CONFIG_MTRR
+module_param(mtrr, int, 0444);
+MODULE_PARM_DESC(mtrr, "Enable write-combining with MTRR (1=enable, 0=disable, default=1)");
+#endif
--
Ondrej Zary
^ permalink raw reply related
* [PATCH 5/5] [resend 2] gxt4500: enable panning
From: Ondrej Zary @ 2015-03-22 19:59 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linux-fbdev, Kernel development list
In-Reply-To: <1427054384-26501-1-git-send-email-linux@rainbow-software.org>
The driver implements pan_display but the corresponding flags are not set.
Add FBINFO_HWACCEL_XPAN and FBINFO_HWACCEL_YPAN to flags to allow HW
accelerated panning (for fast scrolling).
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
---
drivers/video/fbdev/gxt4500.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/gxt4500.c b/drivers/video/fbdev/gxt4500.c
index f278c82..7f97c89 100644
--- a/drivers/video/fbdev/gxt4500.c
+++ b/drivers/video/fbdev/gxt4500.c
@@ -699,7 +699,8 @@ static int gxt4500_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
#endif
info->fbops = &gxt4500_ops;
- info->flags = FBINFO_FLAG_DEFAULT;
+ info->flags = FBINFO_FLAG_DEFAULT | FBINFO_HWACCEL_XPAN |
+ FBINFO_HWACCEL_YPAN;
err = fb_alloc_cmap(&info->cmap, 256, 0);
if (err) {
--
Ondrej Zary
^ permalink raw reply related
* [PATCH 0/13] staging: sm750: reformat sm750.c
From: Michel von Czettritz @ 2015-03-22 23:07 UTC (permalink / raw)
To: linux-fbdev
As suggested by Dan Carpenter, I've rewritten my patch as a series of smaller patches.
Dan's Mail: http://marc.info/?l=kernel-janitors&m\x142679651624193&w=2
Patches 1-12 only reformat code. Patch 13 changes the code, by moving assignments out of if conditions.
The module builds, but as I don't own a sm750 card, I can't test it.
^ permalink raw reply
* [PATCH 01/13] staging: sm750: Reintend
From: Michel von Czettritz @ 2015-03-22 23:08 UTC (permalink / raw)
To: linux-fbdev
The reintend fixes the
"WARNING: please, no spaces at the start of a line",
"ERROR: code indent should use tabs where possible"
and some other small checkpatch.pl warnings and errors.
Signed-off-by: Michel von Czettritz <michel.von.czettritz@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 928 ++++++++++++++++++++--------------------
1 file changed, 464 insertions(+), 464 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index a7b1b9c..459807f 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -31,12 +31,12 @@ int smi_indent = 0;
/*
-#ifdef __BIG_ENDIAN
-ssize_t lynxfb_ops_write(struct fb_info *info, const char __user *buf,
- size_t count, loff_t *ppos);
-ssize_t lynxfb_ops_read(struct fb_info *info, char __user *buf,
- size_t count, loff_t *ppos);
-#endif
+ * #ifdef __BIG_ENDIAN
+ * ssize_t lynxfb_ops_write(struct fb_info *info, const char __user *buf,
+ * size_t count, loff_t *ppos);
+ * ssize_t lynxfb_ops_read(struct fb_info *info, char __user *buf,
+ * size_t count, loff_t *ppos);
+ * #endif
*/
typedef void (*PROC_SPEC_SETUP)(struct lynx_share*,char *);
@@ -76,54 +76,54 @@ static inline void myspin_unlock(spinlock_t * sl){
static const struct fb_videomode lynx750_ext[] = {
/* 1024x600-60 VESA [1.71:1] */
{NULL, 60, 1024, 600, 20423, 144, 40, 18, 1, 104, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
/* 1024x600-70 VESA */
{NULL, 70, 1024, 600, 17211, 152, 48, 21, 1, 104, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
/* 1024x600-75 VESA */
{NULL, 75, 1024, 600, 15822, 160, 56, 23, 1, 104, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
/* 1024x600-85 VESA */
{NULL, 85, 1024, 600, 13730, 168, 56, 26, 1, 112, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
/* 720x480 */
{NULL, 60, 720, 480, 37427, 88, 16, 13, 1, 72, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
/* 1280x720 [1.78:1] */
{NULL, 60, 1280, 720, 13426, 162, 86, 22, 1, 136, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,FB_VMODE_NONINTERLACED},
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,FB_VMODE_NONINTERLACED},
/* 1280x768@60 */
{NULL,60,1280,768,12579,192,64,20,3,128,7,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,FB_VMODE_NONINTERLACED},
+ 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},
+ 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, FB_VMODE_NONINTERLACED},
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
/* 1368 x 768 [1.78:1] */
{NULL, 60, 1368, 768, 11647, 216, 72, 23, 1, 144, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
/* 1440 x 900 [16:10] */
{NULL, 60, 1440, 900, 9392, 232, 80, 28, 1, 152, 3,
- FB_SYNC_VERT_HIGH_ACT,FB_VMODE_NONINTERLACED},
+ FB_SYNC_VERT_HIGH_ACT,FB_VMODE_NONINTERLACED},
/* 1440x960 [15:10] */
{NULL, 60, 1440, 960, 8733, 240, 88, 30, 1, 152, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
/* 1920x1080 [16:9] */
{NULL, 60, 1920, 1080, 6734, 148, 88, 41, 1, 44, 3,
- FB_SYNC_VERT_HIGH_ACT,FB_VMODE_NONINTERLACED},
+ FB_SYNC_VERT_HIGH_ACT,FB_VMODE_NONINTERLACED},
};
@@ -141,8 +141,8 @@ static int lynxfb_ops_cursor(struct fb_info* info,struct fb_cursor* fbcursor)
cursor = &crtc->cursor;
if(fbcursor->image.width > cursor->maxW ||
- fbcursor->image.height > cursor->maxH ||
- fbcursor->image.depth > 1){
+ fbcursor->image.height > cursor->maxH ||
+ fbcursor->image.depth > 1){
return -ENXIO;
}
@@ -153,19 +153,19 @@ static int lynxfb_ops_cursor(struct fb_info* info,struct fb_cursor* fbcursor)
if(fbcursor->set & FB_CUR_SETPOS){
cursor->setPos(cursor,fbcursor->image.dx - info->var.xoffset,
- fbcursor->image.dy - info->var.yoffset);
+ fbcursor->image.dy - info->var.yoffset);
}
if(fbcursor->set & FB_CUR_SETCMAP){
/* get the 16bit color of kernel means */
u16 fg,bg;
fg = ((info->cmap.red[fbcursor->image.fg_color] & 0xf800))|
- ((info->cmap.green[fbcursor->image.fg_color] & 0xfc00) >> 5)|
- ((info->cmap.blue[fbcursor->image.fg_color] & 0xf800) >> 11);
+ ((info->cmap.green[fbcursor->image.fg_color] & 0xfc00) >> 5)|
+ ((info->cmap.blue[fbcursor->image.fg_color] & 0xf800) >> 11);
bg = ((info->cmap.red[fbcursor->image.bg_color] & 0xf800))|
- ((info->cmap.green[fbcursor->image.bg_color] & 0xfc00) >> 5)|
- ((info->cmap.blue[fbcursor->image.bg_color] & 0xf800) >> 11);
+ ((info->cmap.green[fbcursor->image.bg_color] & 0xfc00) >> 5)|
+ ((info->cmap.blue[fbcursor->image.bg_color] & 0xf800) >> 11);
cursor->setColor(cursor,fg,bg);
}
@@ -174,9 +174,9 @@ static int lynxfb_ops_cursor(struct fb_info* info,struct fb_cursor* fbcursor)
if(fbcursor->set & (FB_CUR_SETSHAPE | FB_CUR_SETIMAGE))
{
cursor->setData(cursor,
- fbcursor->rop,
- fbcursor->image.data,
- fbcursor->mask);
+ fbcursor->rop,
+ fbcursor->image.data,
+ fbcursor->mask);
}
if(fbcursor->enable){
@@ -211,10 +211,10 @@ static void lynxfb_ops_fillrect(struct fb_info* info,const struct fb_fillrect* r
myspin_lock(&share->slock);
share->accel.de_fillrect(&share->accel,
- base,pitch,Bpp,
- region->dx,region->dy,
- region->width,region->height,
- color,rop);
+ base,pitch,Bpp,
+ region->dx,region->dy,
+ region->width,region->height,
+ color,rop);
myspin_unlock(&share->slock);
}
@@ -235,9 +235,9 @@ static void lynxfb_ops_copyarea(struct fb_info * info,const struct fb_copyarea *
myspin_lock(&share->slock);
share->accel.de_copyarea(&share->accel,
- base,pitch,region->sx,region->sy,
- base,pitch,Bpp,region->dx,region->dy,
- region->width,region->height,HW_ROP2_COPY);
+ base,pitch,region->sx,region->sy,
+ base,pitch,Bpp,region->dx,region->dy,
+ region->width,region->height,HW_ROP2_COPY);
myspin_unlock(&share->slock);
}
@@ -258,7 +258,7 @@ static void lynxfb_ops_imageblit(struct fb_info*info,const struct fb_image* imag
if(image->depth = 1){
if(info->fix.visual = FB_VISUAL_TRUECOLOR ||
- info->fix.visual = FB_VISUAL_DIRECTCOLOR)
+ info->fix.visual = FB_VISUAL_DIRECTCOLOR)
{
fgcol = ((u32*)info->pseudo_palette)[image->fg_color];
bgcol = ((u32*)info->pseudo_palette)[image->bg_color];
@@ -274,31 +274,31 @@ static void lynxfb_ops_imageblit(struct fb_info*info,const struct fb_image* imag
_do_work:
myspin_lock(&share->slock);
share->accel.de_imageblit(&share->accel,
- image->data,image->width>>3,0,
- base,pitch,Bpp,
- image->dx,image->dy,
- image->width,image->height,
- fgcol,bgcol,HW_ROP2_COPY);
+ image->data,image->width>>3,0,
+ base,pitch,Bpp,
+ image->dx,image->dy,
+ image->width,image->height,
+ fgcol,bgcol,HW_ROP2_COPY);
myspin_unlock(&share->slock);
}
static int lynxfb_ops_pan_display(struct fb_var_screeninfo *var,
- struct fb_info *info)
+ struct fb_info *info)
{
- struct lynxfb_par * par;
- struct lynxfb_crtc * crtc;
- int ret;
-
+ struct lynxfb_par * par;
+ struct lynxfb_crtc * crtc;
+ int ret;
- if(!info)
- return -EINVAL;
- ret = 0;
- par = info->par;
- crtc = &par->crtc;
- ret = crtc->proc_panDisplay(crtc, var, info);
+ if(!info)
+ return -EINVAL;
+
+ ret = 0;
+ par = info->par;
+ crtc = &par->crtc;
+ ret = crtc->proc_panDisplay(crtc, var, info);
- return ret;
+ return ret;
}
static int lynxfb_ops_set_par(struct fb_info * info)
@@ -453,7 +453,7 @@ static int lynxfb_resume(struct pci_dev* pdev)
struct lynx_cursor * cursor;
int ret;
-
+
ret = 0;
share = pci_get_drvdata(pdev);
@@ -519,7 +519,7 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo* var,struct fb_info* in
int ret;
resource_size_t request;
-
+
par = info->par;
crtc = &par->crtc;
output = &par->output;
@@ -604,64 +604,64 @@ exit:
static int lynxfb_ops_setcolreg(unsigned regno,unsigned red,
- unsigned green,unsigned blue,
- unsigned transp,struct fb_info * info)
+ unsigned green,unsigned blue,
+ unsigned transp,struct fb_info * info)
{
- struct lynxfb_par * par;
- struct lynxfb_crtc * crtc;
- struct fb_var_screeninfo * var;
- int ret;
-
- par = info->par;
- crtc = &par->crtc;
- var = &info->var;
- ret = 0;
-
- //pr_debug("regno=%d,red=%d,green=%d,blue=%d\n",regno,red,green,blue);
- if(regno > 256){
- pr_err("regno = %d\n",regno);
- return -EINVAL;
- }
-
- if(info->var.grayscale)
- red = green = blue = (red * 77 + green * 151 + blue * 28) >> 8;
-
- if(var->bits_per_pixel = 8 && info->fix.visual = FB_VISUAL_PSEUDOCOLOR)
- {
- red >>= 8;
- green >>= 8;
- blue >>= 8;
- ret = crtc->proc_setColReg(crtc,regno,red,green,blue);
- goto exit;
- }
-
-
- if(info->fix.visual = FB_VISUAL_TRUECOLOR && regno < 256 )
- {
- u32 val;
- if(var->bits_per_pixel = 16 ||
- var->bits_per_pixel = 32 ||
- var->bits_per_pixel = 24)
- {
- val = chan_to_field(red,&var->red);
- val |= chan_to_field(green,&var->green);
- val |= chan_to_field(blue,&var->blue);
- par->pseudo_palette[regno] = val;
- goto exit;
- }
- }
-
- ret = -EINVAL;
+ struct lynxfb_par * par;
+ struct lynxfb_crtc * crtc;
+ struct fb_var_screeninfo * var;
+ int ret;
+
+ par = info->par;
+ crtc = &par->crtc;
+ var = &info->var;
+ ret = 0;
+
+ //pr_debug("regno=%d,red=%d,green=%d,blue=%d\n",regno,red,green,blue);
+ if(regno > 256){
+ pr_err("regno = %d\n",regno);
+ return -EINVAL;
+ }
+
+ if(info->var.grayscale)
+ red = green = blue = (red * 77 + green * 151 + blue * 28) >> 8;
+
+ if(var->bits_per_pixel = 8 && info->fix.visual = FB_VISUAL_PSEUDOCOLOR)
+ {
+ red >>= 8;
+ green >>= 8;
+ blue >>= 8;
+ ret = crtc->proc_setColReg(crtc,regno,red,green,blue);
+ goto exit;
+ }
+
+
+ if(info->fix.visual = FB_VISUAL_TRUECOLOR && regno < 256 )
+ {
+ u32 val;
+ if(var->bits_per_pixel = 16 ||
+ var->bits_per_pixel = 32 ||
+ var->bits_per_pixel = 24)
+ {
+ val = chan_to_field(red,&var->red);
+ val |= chan_to_field(green,&var->green);
+ val |= chan_to_field(blue,&var->blue);
+ par->pseudo_palette[regno] = val;
+ goto exit;
+ }
+ }
+
+ ret = -EINVAL;
exit:
- return ret;
+ return ret;
}
static int lynxfb_ops_blank(int blank,struct fb_info* info)
{
struct lynxfb_par * par;
struct lynxfb_output * output;
-
+
pr_debug("blank = %d.\n",blank);
par = info->par;
output = &par->output;
@@ -670,89 +670,89 @@ static int lynxfb_ops_blank(int blank,struct fb_info* info)
static int sm750fb_set_drv(struct lynxfb_par * par)
{
- int ret;
- struct lynx_share * share;
- struct sm750_share * spec_share;
- struct lynxfb_output * output;
- struct lynxfb_crtc * crtc;
-
- ret = 0;
-
- share = par->share;
- spec_share = container_of(share,struct sm750_share,share);
- output = &par->output;
- crtc = &par->crtc;
-
- crtc->vidmem_size = (share->dual)?share->vidmem_size>>1:share->vidmem_size;
- /* setup crtc and output member */
- spec_share->hwCursor = g_hwcursor;
-
- crtc->proc_setMode = hw_sm750_crtc_setMode;
- crtc->proc_checkMode = hw_sm750_crtc_checkMode;
- crtc->proc_setColReg = hw_sm750_setColReg;
- crtc->proc_panDisplay = hw_sm750_pan_display;
- crtc->clear = hw_sm750_crtc_clear;
- crtc->line_pad = 16;
- //crtc->xpanstep = crtc->ypanstep = crtc->ywrapstep = 0;
- crtc->xpanstep = 8;
- crtc->ypanstep = 1;
- crtc->ywrapstep = 0;
-
- output->proc_setMode = hw_sm750_output_setMode;
- output->proc_checkMode = hw_sm750_output_checkMode;
-
- output->proc_setBLANK = (share->revid = SM750LE_REVISION_ID)?hw_sm750le_setBLANK:hw_sm750_setBLANK;
- output->clear = hw_sm750_output_clear;
- /* chip specific phase */
- share->accel.de_wait = (share->revid = SM750LE_REVISION_ID)?hw_sm750le_deWait: hw_sm750_deWait;
- switch (spec_share->state.dataflow)
- {
- case sm750_simul_pri:
- output->paths = sm750_pnc;
- crtc->channel = sm750_primary;
- crtc->oScreen = 0;
- crtc->vScreen = share->pvMem;
- pr_info("use simul primary mode\n");
- break;
- case sm750_simul_sec:
- output->paths = sm750_pnc;
- crtc->channel = sm750_secondary;
- crtc->oScreen = 0;
- crtc->vScreen = share->pvMem;
- break;
- case sm750_dual_normal:
- if(par->index = 0){
- output->paths = sm750_panel;
- crtc->channel = sm750_primary;
- crtc->oScreen = 0;
- crtc->vScreen = share->pvMem;
- }else{
- output->paths = sm750_crt;
- crtc->channel = sm750_secondary;
- /* not consider of padding stuffs for oScreen,need fix*/
- crtc->oScreen = (share->vidmem_size >> 1);
- crtc->vScreen = share->pvMem + crtc->oScreen;
- }
- break;
- case sm750_dual_swap:
- if(par->index = 0){
- output->paths = sm750_panel;
- crtc->channel = sm750_secondary;
- crtc->oScreen = 0;
- crtc->vScreen = share->pvMem;
- }else{
- output->paths = sm750_crt;
- crtc->channel = sm750_primary;
- /* not consider of padding stuffs for oScreen,need fix*/
- crtc->oScreen = (share->vidmem_size >> 1);
- crtc->vScreen = share->pvMem + crtc->oScreen;
- }
- break;
- default:
- ret = -EINVAL;
- }
-
- return ret;
+ int ret;
+ struct lynx_share * share;
+ struct sm750_share * spec_share;
+ struct lynxfb_output * output;
+ struct lynxfb_crtc * crtc;
+
+ ret = 0;
+
+ share = par->share;
+ spec_share = container_of(share,struct sm750_share,share);
+ output = &par->output;
+ crtc = &par->crtc;
+
+ crtc->vidmem_size = (share->dual)?share->vidmem_size>>1:share->vidmem_size;
+ /* setup crtc and output member */
+ spec_share->hwCursor = g_hwcursor;
+
+ crtc->proc_setMode = hw_sm750_crtc_setMode;
+ crtc->proc_checkMode = hw_sm750_crtc_checkMode;
+ crtc->proc_setColReg = hw_sm750_setColReg;
+ crtc->proc_panDisplay = hw_sm750_pan_display;
+ crtc->clear = hw_sm750_crtc_clear;
+ crtc->line_pad = 16;
+ //crtc->xpanstep = crtc->ypanstep = crtc->ywrapstep = 0;
+ crtc->xpanstep = 8;
+ crtc->ypanstep = 1;
+ crtc->ywrapstep = 0;
+
+ output->proc_setMode = hw_sm750_output_setMode;
+ output->proc_checkMode = hw_sm750_output_checkMode;
+
+ output->proc_setBLANK = (share->revid = SM750LE_REVISION_ID)?hw_sm750le_setBLANK:hw_sm750_setBLANK;
+ output->clear = hw_sm750_output_clear;
+ /* chip specific phase */
+ share->accel.de_wait = (share->revid = SM750LE_REVISION_ID)?hw_sm750le_deWait: hw_sm750_deWait;
+ switch (spec_share->state.dataflow)
+ {
+ case sm750_simul_pri:
+ output->paths = sm750_pnc;
+ crtc->channel = sm750_primary;
+ crtc->oScreen = 0;
+ crtc->vScreen = share->pvMem;
+ pr_info("use simul primary mode\n");
+ break;
+ case sm750_simul_sec:
+ output->paths = sm750_pnc;
+ crtc->channel = sm750_secondary;
+ crtc->oScreen = 0;
+ crtc->vScreen = share->pvMem;
+ break;
+ case sm750_dual_normal:
+ if(par->index = 0){
+ output->paths = sm750_panel;
+ crtc->channel = sm750_primary;
+ crtc->oScreen = 0;
+ crtc->vScreen = share->pvMem;
+ }else{
+ output->paths = sm750_crt;
+ crtc->channel = sm750_secondary;
+ /* not consider of padding stuffs for oScreen,need fix*/
+ crtc->oScreen = (share->vidmem_size >> 1);
+ crtc->vScreen = share->pvMem + crtc->oScreen;
+ }
+ break;
+ case sm750_dual_swap:
+ if(par->index = 0){
+ output->paths = sm750_panel;
+ crtc->channel = sm750_secondary;
+ crtc->oScreen = 0;
+ crtc->vScreen = share->pvMem;
+ }else{
+ output->paths = sm750_crt;
+ crtc->channel = sm750_primary;
+ /* not consider of padding stuffs for oScreen,need fix*/
+ crtc->oScreen = (share->vidmem_size >> 1);
+ crtc->vScreen = share->pvMem + crtc->oScreen;
+ }
+ break;
+ default:
+ ret = -EINVAL;
+ }
+
+ return ret;
}
static struct fb_ops lynxfb_ops={
@@ -771,86 +771,86 @@ static struct fb_ops lynxfb_ops={
static int lynxfb_set_fbinfo(struct fb_info* info,int index)
{
- int i;
- struct lynxfb_par * par;
- struct lynx_share * share;
- struct lynxfb_crtc * crtc;
- struct lynxfb_output * output;
- struct fb_var_screeninfo * var;
- struct fb_fix_screeninfo * fix;
-
- const struct fb_videomode * pdb[] = {
- lynx750_ext, NULL,vesa_modes,
- };
- int cdb[] = {ARRAY_SIZE(lynx750_ext),0,VESA_MODEDB_SIZE};
- static const char * mdb_desc[] ={
- "driver prepared modes",
- "kernel prepared default modedb",
- "kernel HELPERS prepared vesa_modes",
- };
-
-
- static const char * fixId[2]- {
- "sm750_fb1","sm750_fb2",
- };
-
- int ret,line_length;
-
- ret = 0;
- par = (struct lynxfb_par *)info->par;
- share = par->share;
- crtc = &par->crtc;
- output = &par->output;
- var = &info->var;
- fix = &info->fix;
-
- /* set index */
- par->index = index;
- output->channel = &crtc->channel;
+ int i;
+ struct lynxfb_par * par;
+ struct lynx_share * share;
+ struct lynxfb_crtc * crtc;
+ struct lynxfb_output * output;
+ struct fb_var_screeninfo * var;
+ struct fb_fix_screeninfo * fix;
+
+ const struct fb_videomode * pdb[] = {
+ lynx750_ext, NULL,vesa_modes,
+ };
+ int cdb[] = {ARRAY_SIZE(lynx750_ext),0,VESA_MODEDB_SIZE};
+ static const char * mdb_desc[] ={
+ "driver prepared modes",
+ "kernel prepared default modedb",
+ "kernel HELPERS prepared vesa_modes",
+ };
+
+
+ static const char * fixId[2]+ {
+ "sm750_fb1","sm750_fb2",
+ };
+
+ int ret,line_length;
+
+ ret = 0;
+ par = (struct lynxfb_par *)info->par;
+ share = par->share;
+ crtc = &par->crtc;
+ output = &par->output;
+ var = &info->var;
+ fix = &info->fix;
+
+ /* set index */
+ par->index = index;
+ output->channel = &crtc->channel;
sm750fb_set_drv(par);
- lynxfb_ops.fb_pan_display = lynxfb_ops_pan_display;
-
-
- /* set current cursor variable and proc pointer,
- * must be set after crtc member initialized */
- crtc->cursor.offset = crtc->oScreen + crtc->vidmem_size - 1024;
- crtc->cursor.mmio = share->pvReg + 0x800f0 + (int)crtc->channel * 0x140;
-
- pr_info("crtc->cursor.mmio = %p\n",crtc->cursor.mmio);
- crtc->cursor.maxH = crtc->cursor.maxW = 64;
- crtc->cursor.size = crtc->cursor.maxH*crtc->cursor.maxW*2/8;
- crtc->cursor.disable = hw_cursor_disable;
- crtc->cursor.enable = hw_cursor_enable;
- crtc->cursor.setColor = hw_cursor_setColor;
- crtc->cursor.setPos = hw_cursor_setPos;
- crtc->cursor.setSize = hw_cursor_setSize;
- crtc->cursor.setData = hw_cursor_setData;
- crtc->cursor.vstart = share->pvMem + crtc->cursor.offset;
-
-
- crtc->cursor.share = share;
- memset(crtc->cursor.vstart, 0, crtc->cursor.size);
- if(!g_hwcursor){
- lynxfb_ops.fb_cursor = NULL;
- crtc->cursor.disable(&crtc->cursor);
- }
-
-
- /* set info->fbops, must be set before fb_find_mode */
- if(!share->accel_off){
- /* use 2d acceleration */
- lynxfb_ops.fb_fillrect = lynxfb_ops_fillrect;
- lynxfb_ops.fb_copyarea = lynxfb_ops_copyarea;
- lynxfb_ops.fb_imageblit = lynxfb_ops_imageblit;
- }
- info->fbops = &lynxfb_ops;
-
- if(!g_fbmode[index]){
- g_fbmode[index] = g_def_fbmode;
- if(index)
- g_fbmode[index] = g_fbmode[0];
- }
+ lynxfb_ops.fb_pan_display = lynxfb_ops_pan_display;
+
+
+ /* set current cursor variable and proc pointer,
+ * must be set after crtc member initialized */
+ crtc->cursor.offset = crtc->oScreen + crtc->vidmem_size - 1024;
+ crtc->cursor.mmio = share->pvReg + 0x800f0 + (int)crtc->channel * 0x140;
+
+ pr_info("crtc->cursor.mmio = %p\n",crtc->cursor.mmio);
+ crtc->cursor.maxH = crtc->cursor.maxW = 64;
+ crtc->cursor.size = crtc->cursor.maxH*crtc->cursor.maxW*2/8;
+ crtc->cursor.disable = hw_cursor_disable;
+ crtc->cursor.enable = hw_cursor_enable;
+ crtc->cursor.setColor = hw_cursor_setColor;
+ crtc->cursor.setPos = hw_cursor_setPos;
+ crtc->cursor.setSize = hw_cursor_setSize;
+ crtc->cursor.setData = hw_cursor_setData;
+ crtc->cursor.vstart = share->pvMem + crtc->cursor.offset;
+
+
+ crtc->cursor.share = share;
+ memset(crtc->cursor.vstart, 0, crtc->cursor.size);
+ if(!g_hwcursor){
+ lynxfb_ops.fb_cursor = NULL;
+ crtc->cursor.disable(&crtc->cursor);
+ }
+
+
+ /* set info->fbops, must be set before fb_find_mode */
+ if(!share->accel_off){
+ /* use 2d acceleration */
+ lynxfb_ops.fb_fillrect = lynxfb_ops_fillrect;
+ lynxfb_ops.fb_copyarea = lynxfb_ops_copyarea;
+ lynxfb_ops.fb_imageblit = lynxfb_ops_imageblit;
+ }
+ info->fbops = &lynxfb_ops;
+
+ if(!g_fbmode[index]){
+ g_fbmode[index] = g_def_fbmode;
+ if(index)
+ g_fbmode[index] = g_fbmode[0];
+ }
for(i=0;i<3;i++){
@@ -870,7 +870,7 @@ static int lynxfb_set_fbinfo(struct fb_info* info,int index)
break;
}else if(ret = 3){
pr_warn("wanna use default mode\n");
-// break;
+ // break;
}else if(ret = 4){
pr_warn("fall back to any valid mode\n");
}else{
@@ -878,94 +878,94 @@ static int lynxfb_set_fbinfo(struct fb_info* info,int index)
}
}
- /* some member of info->var had been set by fb_find_mode */
-
- pr_info("Member of info->var is :\n\
- xres=%d\n\
- yres=%d\n\
- xres_virtual=%d\n\
- yres_virtual=%d\n\
- xoffset=%d\n\
- yoffset=%d\n\
- bits_per_pixel=%d\n \
- ...\n",var->xres,var->yres,var->xres_virtual,var->yres_virtual,
- var->xoffset,var->yoffset,var->bits_per_pixel);
-
- /* set par */
- par->info = info;
-
- /* set info */
- line_length = PADDING(crtc->line_pad,
- (var->xres_virtual * var->bits_per_pixel/8));
-
- info->pseudo_palette = &par->pseudo_palette[0];
- info->screen_base = crtc->vScreen;
- pr_debug("screen_base vaddr = %p\n",info->screen_base);
+ /* some member of info->var had been set by fb_find_mode */
+
+ pr_info("Member of info->var is :\n\
+ xres=%d\n\
+ yres=%d\n\
+ xres_virtual=%d\n\
+ yres_virtual=%d\n\
+ xoffset=%d\n\
+ yoffset=%d\n\
+ bits_per_pixel=%d\n \
+ ...\n",var->xres,var->yres,var->xres_virtual,var->yres_virtual,
+ var->xoffset,var->yoffset,var->bits_per_pixel);
+
+ /* set par */
+ par->info = info;
+
+ /* set info */
+ line_length = PADDING(crtc->line_pad,
+ (var->xres_virtual * var->bits_per_pixel/8));
+
+ info->pseudo_palette = &par->pseudo_palette[0];
+ info->screen_base = crtc->vScreen;
+ pr_debug("screen_base vaddr = %p\n",info->screen_base);
info->screen_size = line_length * var->yres_virtual;
info->flags = FBINFO_FLAG_DEFAULT|0;
- /* set info->fix */
- fix->type = FB_TYPE_PACKED_PIXELS;
- fix->type_aux = 0;
- fix->xpanstep = crtc->xpanstep;
- fix->ypanstep = crtc->ypanstep;
- fix->ywrapstep = crtc->ywrapstep;
- fix->accel = FB_ACCEL_SMI;
+ /* set info->fix */
+ fix->type = FB_TYPE_PACKED_PIXELS;
+ fix->type_aux = 0;
+ fix->xpanstep = crtc->xpanstep;
+ fix->ypanstep = crtc->ypanstep;
+ fix->ywrapstep = crtc->ywrapstep;
+ fix->accel = FB_ACCEL_SMI;
- strlcpy(fix->id,fixId[index],sizeof(fix->id));
+ strlcpy(fix->id,fixId[index],sizeof(fix->id));
fix->smem_start = crtc->oScreen + share->vidmem_start;
pr_info("fix->smem_start = %lx\n",fix->smem_start);
- /* according to mmap experiment from user space application,
- * fix->mmio_len should not larger than virtual size
- * (xres_virtual x yres_virtual x ByPP)
- * Below line maybe buggy when user mmap fb dev node and write
- * data into the bound over virtual size
- * */
- fix->smem_len = crtc->vidmem_size;
- pr_info("fix->smem_len = %x\n",fix->smem_len);
- info->screen_size = fix->smem_len;
- fix->line_length = line_length;
- fix->mmio_start = share->vidreg_start;
- pr_info("fix->mmio_start = %lx\n",fix->mmio_start);
- fix->mmio_len = share->vidreg_size;
- pr_info("fix->mmio_len = %x\n",fix->mmio_len);
- switch(var->bits_per_pixel)
- {
- case 8:
- fix->visual = FB_VISUAL_PSEUDOCOLOR;
- break;
- case 16:
- case 32:
- fix->visual = FB_VISUAL_TRUECOLOR;
- break;
- }
-
- /* set var */
- var->activate = FB_ACTIVATE_NOW;
- var->accel_flags = 0;
- var->vmode = FB_VMODE_NONINTERLACED;
-
- pr_debug("#1 show info->cmap : \nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n",
- info->cmap.start,info->cmap.len,
- info->cmap.red,info->cmap.green,info->cmap.blue,
- info->cmap.transp);
-
- if((ret = fb_alloc_cmap(&info->cmap,256,0)) < 0){
- pr_err("Could not allcate memory for cmap.\n");
- goto exit;
- }
-
- pr_debug("#2 show info->cmap : \nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n",
- info->cmap.start,info->cmap.len,
- info->cmap.red,info->cmap.green,info->cmap.blue,
- info->cmap.transp);
+ /* according to mmap experiment from user space application,
+ * fix->mmio_len should not larger than virtual size
+ * (xres_virtual x yres_virtual x ByPP)
+ * Below line maybe buggy when user mmap fb dev node and write
+ * data into the bound over virtual size
+ * */
+ fix->smem_len = crtc->vidmem_size;
+ pr_info("fix->smem_len = %x\n",fix->smem_len);
+ info->screen_size = fix->smem_len;
+ fix->line_length = line_length;
+ fix->mmio_start = share->vidreg_start;
+ pr_info("fix->mmio_start = %lx\n",fix->mmio_start);
+ fix->mmio_len = share->vidreg_size;
+ pr_info("fix->mmio_len = %x\n",fix->mmio_len);
+ switch(var->bits_per_pixel)
+ {
+ case 8:
+ fix->visual = FB_VISUAL_PSEUDOCOLOR;
+ break;
+ case 16:
+ case 32:
+ fix->visual = FB_VISUAL_TRUECOLOR;
+ break;
+ }
+
+ /* set var */
+ var->activate = FB_ACTIVATE_NOW;
+ var->accel_flags = 0;
+ var->vmode = FB_VMODE_NONINTERLACED;
+
+ pr_debug("#1 show info->cmap : \nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n",
+ info->cmap.start,info->cmap.len,
+ info->cmap.red,info->cmap.green,info->cmap.blue,
+ info->cmap.transp);
+
+ if((ret = fb_alloc_cmap(&info->cmap,256,0)) < 0){
+ pr_err("Could not allcate memory for cmap.\n");
+ goto exit;
+ }
+
+ pr_debug("#2 show info->cmap : \nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n",
+ info->cmap.start,info->cmap.len,
+ info->cmap.red,info->cmap.green,info->cmap.blue,
+ info->cmap.transp);
exit:
lynxfb_ops_check_var(var,info);
-// lynxfb_ops_set_par(info);
- return ret;
+ // lynxfb_ops_set_par(info);
+ return ret;
}
/* chip specific g_option configuration routine */
@@ -977,94 +977,94 @@ static void sm750fb_setup(struct lynx_share * share,char * src)
char * exp_res;
#endif
int swap;
-
+
spec_share = container_of(share,struct sm750_share,share);
#ifdef CAP_EXPENSIION
- exp_res = NULL;
+ exp_res = NULL;
#endif
- swap = 0;
-
- spec_share->state.initParm.chip_clk = 0;
- spec_share->state.initParm.mem_clk = 0;
- spec_share->state.initParm.master_clk = 0;
- spec_share->state.initParm.powerMode = 0;
- spec_share->state.initParm.setAllEngOff = 0;
- spec_share->state.initParm.resetMemory = 1;
-
- /*defaultly turn g_hwcursor on for both view */
- g_hwcursor = 3;
-
- if(!src || !*src){
- pr_warn("no specific g_option.\n");
- goto NO_PARAM;
- }
-
- while((opt = strsep(&src,":")) != NULL && *opt != 0){
- pr_err("opt=%s\n",opt);
- pr_err("src=%s\n",src);
-
- if(!strncmp(opt,"swap",strlen("swap")))
- swap = 1;
- else if(!strncmp(opt,"nocrt",strlen("nocrt")))
- spec_share->state.nocrt = 1;
- else if(!strncmp(opt,"36bit",strlen("36bit")))
- spec_share->state.pnltype = sm750_doubleTFT;
- else if(!strncmp(opt,"18bit",strlen("18bit")))
- spec_share->state.pnltype = sm750_dualTFT;
- else if(!strncmp(opt,"24bit",strlen("24bit")))
- spec_share->state.pnltype = sm750_24TFT;
+ swap = 0;
+
+ spec_share->state.initParm.chip_clk = 0;
+ spec_share->state.initParm.mem_clk = 0;
+ spec_share->state.initParm.master_clk = 0;
+ spec_share->state.initParm.powerMode = 0;
+ spec_share->state.initParm.setAllEngOff = 0;
+ spec_share->state.initParm.resetMemory = 1;
+
+ /*defaultly turn g_hwcursor on for both view */
+ g_hwcursor = 3;
+
+ if(!src || !*src){
+ pr_warn("no specific g_option.\n");
+ goto NO_PARAM;
+ }
+
+ while((opt = strsep(&src,":")) != NULL && *opt != 0){
+ pr_err("opt=%s\n",opt);
+ pr_err("src=%s\n",src);
+
+ if(!strncmp(opt,"swap",strlen("swap")))
+ swap = 1;
+ else if(!strncmp(opt,"nocrt",strlen("nocrt")))
+ spec_share->state.nocrt = 1;
+ else if(!strncmp(opt,"36bit",strlen("36bit")))
+ spec_share->state.pnltype = sm750_doubleTFT;
+ else if(!strncmp(opt,"18bit",strlen("18bit")))
+ spec_share->state.pnltype = sm750_dualTFT;
+ else if(!strncmp(opt,"24bit",strlen("24bit")))
+ spec_share->state.pnltype = sm750_24TFT;
#ifdef CAP_EXPANSION
- else if(!strncmp(opt,"exp:",strlen("exp:")))
- exp_res = opt + strlen("exp:");
+ else if(!strncmp(opt,"exp:",strlen("exp:")))
+ exp_res = opt + strlen("exp:");
#endif
- else if(!strncmp(opt,"nohwc0",strlen("nohwc0")))
- g_hwcursor &= ~0x1;
- else if(!strncmp(opt,"nohwc1",strlen("nohwc1")))
- g_hwcursor &= ~0x2;
- else if(!strncmp(opt,"nohwc",strlen("nohwc")))
- g_hwcursor = 0;
- else
- {
- if(!g_fbmode[0]){
- g_fbmode[0] = opt;
- pr_info("find fbmode0 : %s\n",g_fbmode[0]);
- }else if(!g_fbmode[1]){
- g_fbmode[1] = opt;
- pr_info("find fbmode1 : %s\n",g_fbmode[1]);
- }else{
- pr_warn("How many view you wann set?\n");
- }
- }
- }
+ else if(!strncmp(opt,"nohwc0",strlen("nohwc0")))
+ g_hwcursor &= ~0x1;
+ else if(!strncmp(opt,"nohwc1",strlen("nohwc1")))
+ g_hwcursor &= ~0x2;
+ else if(!strncmp(opt,"nohwc",strlen("nohwc")))
+ g_hwcursor = 0;
+ else
+ {
+ if(!g_fbmode[0]){
+ g_fbmode[0] = opt;
+ pr_info("find fbmode0 : %s\n",g_fbmode[0]);
+ }else if(!g_fbmode[1]){
+ g_fbmode[1] = opt;
+ pr_info("find fbmode1 : %s\n",g_fbmode[1]);
+ }else{
+ pr_warn("How many view you wann set?\n");
+ }
+ }
+ }
#ifdef CAP_EXPANSION
- if(getExpRes(exp_res,&spec_share->state.xLCD,&spec_share->state.yLCD))
- {
- /* seems exp_res is not valid*/
- spec_share->state.xLCD = spec_share->state.yLCD = 0;
- }
+ if(getExpRes(exp_res,&spec_share->state.xLCD,&spec_share->state.yLCD))
+ {
+ /* seems exp_res is not valid*/
+ spec_share->state.xLCD = spec_share->state.yLCD = 0;
+ }
#endif
NO_PARAM:
- if(share->revid != SM750LE_REVISION_ID){
- if(share->dual)
- {
- if(swap)
- spec_share->state.dataflow = sm750_dual_swap;
- else
- spec_share->state.dataflow = sm750_dual_normal;
- }else{
- if(swap)
- spec_share->state.dataflow = sm750_simul_sec;
- else
- spec_share->state.dataflow = sm750_simul_pri;
- }
- }else{
- /* SM750LE only have one crt channel */
- spec_share->state.dataflow = sm750_simul_sec;
- /* sm750le do not have complex attributes*/
- spec_share->state.nocrt = 0;
- }
+ if(share->revid != SM750LE_REVISION_ID){
+ if(share->dual)
+ {
+ if(swap)
+ spec_share->state.dataflow = sm750_dual_swap;
+ else
+ spec_share->state.dataflow = sm750_dual_normal;
+ }else{
+ if(swap)
+ spec_share->state.dataflow = sm750_simul_sec;
+ else
+ spec_share->state.dataflow = sm750_simul_pri;
+ }
+ }else{
+ /* SM750LE only have one crt channel */
+ spec_share->state.dataflow = sm750_simul_sec;
+ /* sm750le do not have complex attributes*/
+ spec_share->state.nocrt = 0;
+ }
}
static int lynxfb_pci_probe(struct pci_dev * pdev,
@@ -1076,7 +1076,7 @@ static int lynxfb_pci_probe(struct pci_dev * pdev,
struct sm750_share *spec_share = NULL;
size_t spec_offset = 0;
int fbidx;
-
+
/* enable device */
if(pci_enable_device(pdev)){
@@ -1161,52 +1161,52 @@ static int lynxfb_pci_probe(struct pci_dev * pdev,
hw_sm750_inithw(share,pdev);
/* allocate frame buffer info structor according to g_dualview */
- fbidx = 0;
+ fbidx = 0;
ALLOC_FB:
- info[fbidx] = framebuffer_alloc(sizeof(struct lynxfb_par),&pdev->dev);
- if(!info[fbidx])
- {
- pr_err("Could not allocate framebuffer #%d.\n",fbidx);
+ info[fbidx] = framebuffer_alloc(sizeof(struct lynxfb_par),&pdev->dev);
+ if(!info[fbidx])
+ {
+ pr_err("Could not allocate framebuffer #%d.\n",fbidx);
+ if(fbidx = 0)
+ goto err_info0_alloc;
+ else
+ goto err_info1_alloc;
+ }
+ else
+ {
+ struct lynxfb_par * par;
+ int errno;
+ pr_info("framebuffer #%d alloc okay\n",fbidx);
+ share->fbinfo[fbidx] = info[fbidx];
+ par = info[fbidx]->par;
+ par->share = share;
+
+ /* set fb_info structure */
+ if(lynxfb_set_fbinfo(info[fbidx],fbidx)){
+ pr_err("Failed to initial fb_info #%d.\n",fbidx);
if(fbidx = 0)
- goto err_info0_alloc;
+ goto err_info0_set;
else
- goto err_info1_alloc;
+ goto err_info1_set;
}
- else
- {
- struct lynxfb_par * par;
- int errno;
- pr_info("framebuffer #%d alloc okay\n",fbidx);
- share->fbinfo[fbidx] = info[fbidx];
- par = info[fbidx]->par;
- par->share = share;
-
- /* set fb_info structure */
- if(lynxfb_set_fbinfo(info[fbidx],fbidx)){
- pr_err("Failed to initial fb_info #%d.\n",fbidx);
- if(fbidx = 0)
- goto err_info0_set;
- else
- goto err_info1_set;
- }
- /* register frame buffer*/
- pr_info("Ready to register framebuffer #%d.\n",fbidx);
- errno = register_framebuffer(info[fbidx]);
- if (errno < 0) {
- pr_err("Failed to register fb_info #%d. err %d\n",fbidx, errno);
- if(fbidx = 0)
- goto err_register0;
- else
- goto err_register1;
- }
- pr_info("Accomplished register framebuffer #%d.\n",fbidx);
+ /* register frame buffer*/
+ pr_info("Ready to register framebuffer #%d.\n",fbidx);
+ errno = register_framebuffer(info[fbidx]);
+ if (errno < 0) {
+ pr_err("Failed to register fb_info #%d. err %d\n",fbidx, errno);
+ if(fbidx = 0)
+ goto err_register0;
+ else
+ goto err_register1;
}
+ pr_info("Accomplished register framebuffer #%d.\n",fbidx);
+ }
- /* no dual view by far */
- fbidx++;
- if(share->dual && fbidx < 2)
- goto ALLOC_FB;
+ /* no dual view by far */
+ fbidx++;
+ if(share->dual && fbidx < 2)
+ goto ALLOC_FB;
return 0;
@@ -1268,7 +1268,7 @@ static int __init lynxfb_setup(char * options)
{
int len;
char * opt,*tmp;
-
+
if(!options || !*options){
pr_warn("no options.\n");
--
2.3.3
^ permalink raw reply related
* [PATCH 02/13] staging: sm750: add missing spaces after ','
From: Michel von Czettritz @ 2015-03-22 23:11 UTC (permalink / raw)
To: linux-fbdev
Fixes checkpatch.pl error:
"ERROR: space required after that ',' (ctx:VxV)"
Signed-off-by: Michel von Czettritz <michel.von.czettritz@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 264 ++++++++++++++++++++--------------------
1 file changed, 132 insertions(+), 132 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 459807f..83c81d2 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -50,7 +50,7 @@ static int g_noaccel;
#ifdef CONFIG_MTRR
static int g_nomtrr;
#endif
-static const char * g_fbmode[] = {NULL,NULL};
+static const char * g_fbmode[] = {NULL, NULL};
static const char * g_def_fbmode = "800x600-16@60";
static char * g_settings = NULL;
static int g_dualview;
@@ -60,7 +60,7 @@ static char * g_option = NULL;
* and immediatly unload driver frequently (dual)*/
static inline void myspin_lock(spinlock_t * sl){
struct lynx_share * share;
- share = container_of(sl,struct lynx_share,slock);
+ share = container_of(sl, struct lynx_share, slock);
if(share->dual){
spin_lock(sl);
}
@@ -68,7 +68,7 @@ static inline void myspin_lock(spinlock_t * sl){
static inline void myspin_unlock(spinlock_t * sl){
struct lynx_share * share;
- share = container_of(sl,struct lynx_share,slock);
+ share = container_of(sl, struct lynx_share, slock);
if(share->dual){
spin_unlock(sl);
}
@@ -96,13 +96,13 @@ static const struct fb_videomode lynx750_ext[] = {
/* 1280x720 [1.78:1] */
{NULL, 60, 1280, 720, 13426, 162, 86, 22, 1, 136, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,FB_VMODE_NONINTERLACED},
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
/* 1280x768@60 */
- {NULL,60,1280,768,12579,192,64,20,3,128,7,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,FB_VMODE_NONINTERLACED},
+ {NULL, 60, 1280, 768, 12579, 192, 64, 20, 3, 128, 7,
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
- {NULL,60,1360,768,11804,208,64,23,1,144,3,
+ {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] */
@@ -115,7 +115,7 @@ static const struct fb_videomode lynx750_ext[] = {
/* 1440 x 900 [16:10] */
{NULL, 60, 1440, 900, 9392, 232, 80, 28, 1, 152, 3,
- FB_SYNC_VERT_HIGH_ACT,FB_VMODE_NONINTERLACED},
+ FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
/* 1440x960 [15:10] */
{NULL, 60, 1440, 960, 8733, 240, 88, 30, 1, 152, 3,
@@ -123,14 +123,14 @@ static const struct fb_videomode lynx750_ext[] = {
/* 1920x1080 [16:9] */
{NULL, 60, 1920, 1080, 6734, 148, 88, 41, 1, 44, 3,
- FB_SYNC_VERT_HIGH_ACT,FB_VMODE_NONINTERLACED},
+ FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
};
/* no hardware cursor supported under version 2.6.10, kernel bug */
-static int lynxfb_ops_cursor(struct fb_info* info,struct fb_cursor* fbcursor)
+static int lynxfb_ops_cursor(struct fb_info* info, struct fb_cursor* fbcursor)
{
struct lynxfb_par * par;
struct lynxfb_crtc * crtc;
@@ -148,17 +148,17 @@ static int lynxfb_ops_cursor(struct fb_info* info,struct fb_cursor* fbcursor)
cursor->disable(cursor);
if(fbcursor->set & FB_CUR_SETSIZE){
- cursor->setSize(cursor,fbcursor->image.width,fbcursor->image.height);
+ cursor->setSize(cursor, fbcursor->image.width, fbcursor->image.height);
}
if(fbcursor->set & FB_CUR_SETPOS){
- cursor->setPos(cursor,fbcursor->image.dx - info->var.xoffset,
+ cursor->setPos(cursor, fbcursor->image.dx - info->var.xoffset,
fbcursor->image.dy - info->var.yoffset);
}
if(fbcursor->set & FB_CUR_SETCMAP){
/* get the 16bit color of kernel means */
- u16 fg,bg;
+ u16 fg, bg;
fg = ((info->cmap.red[fbcursor->image.fg_color] & 0xf800))|
((info->cmap.green[fbcursor->image.fg_color] & 0xfc00) >> 5)|
((info->cmap.blue[fbcursor->image.fg_color] & 0xf800) >> 11);
@@ -167,7 +167,7 @@ static int lynxfb_ops_cursor(struct fb_info* info,struct fb_cursor* fbcursor)
((info->cmap.green[fbcursor->image.bg_color] & 0xfc00) >> 5)|
((info->cmap.blue[fbcursor->image.bg_color] & 0xf800) >> 11);
- cursor->setColor(cursor,fg,bg);
+ cursor->setColor(cursor, fg, bg);
}
@@ -186,11 +186,11 @@ static int lynxfb_ops_cursor(struct fb_info* info,struct fb_cursor* fbcursor)
return 0;
}
-static void lynxfb_ops_fillrect(struct fb_info* info,const struct fb_fillrect* region)
+static void lynxfb_ops_fillrect(struct fb_info* info, const struct fb_fillrect* region)
{
struct lynxfb_par * par;
struct lynx_share * share;
- unsigned int base,pitch,Bpp,rop;
+ unsigned int base, pitch, Bpp, rop;
u32 color;
if(info->state != FBINFO_STATE_RUNNING){
@@ -211,18 +211,18 @@ static void lynxfb_ops_fillrect(struct fb_info* info,const struct fb_fillrect* r
myspin_lock(&share->slock);
share->accel.de_fillrect(&share->accel,
- base,pitch,Bpp,
- region->dx,region->dy,
- region->width,region->height,
- color,rop);
+ base, pitch, Bpp,
+ region->dx, region->dy,
+ region->width, region->height,
+ color, rop);
myspin_unlock(&share->slock);
}
-static void lynxfb_ops_copyarea(struct fb_info * info,const struct fb_copyarea * region)
+static void lynxfb_ops_copyarea(struct fb_info * info, const struct fb_copyarea * region)
{
struct lynxfb_par * par;
struct lynx_share * share;
- unsigned int base,pitch,Bpp;
+ unsigned int base, pitch, Bpp;
par = info->par;
share = par->share;
@@ -235,16 +235,16 @@ static void lynxfb_ops_copyarea(struct fb_info * info,const struct fb_copyarea *
myspin_lock(&share->slock);
share->accel.de_copyarea(&share->accel,
- base,pitch,region->sx,region->sy,
- base,pitch,Bpp,region->dx,region->dy,
- region->width,region->height,HW_ROP2_COPY);
+ base, pitch, region->sx, region->sy,
+ base, pitch, Bpp, region->dx, region->dy,
+ region->width, region->height, HW_ROP2_COPY);
myspin_unlock(&share->slock);
}
-static void lynxfb_ops_imageblit(struct fb_info*info,const struct fb_image* image)
+static void lynxfb_ops_imageblit(struct fb_info*info, const struct fb_image* image)
{
- unsigned int base,pitch,Bpp;
- unsigned int fgcol,bgcol;
+ unsigned int base, pitch, Bpp;
+ unsigned int fgcol, bgcol;
struct lynxfb_par * par;
struct lynx_share * share;
@@ -274,11 +274,11 @@ static void lynxfb_ops_imageblit(struct fb_info*info,const struct fb_image* imag
_do_work:
myspin_lock(&share->slock);
share->accel.de_imageblit(&share->accel,
- image->data,image->width>>3,0,
- base,pitch,Bpp,
- image->dx,image->dy,
- image->width,image->height,
- fgcol,bgcol,HW_ROP2_COPY);
+ image->data, image->width>>3, 0,
+ base, pitch, Bpp,
+ image->dx, image->dy,
+ image->width, image->height,
+ fgcol, bgcol, HW_ROP2_COPY);
myspin_unlock(&share->slock);
}
@@ -325,9 +325,9 @@ static int lynxfb_ops_set_par(struct fb_info * info)
/* fix structur is not so FIX ... */
line_length = var->xres_virtual * var->bits_per_pixel / 8;
- line_length = PADDING(crtc->line_pad,line_length);
+ line_length = PADDING(crtc->line_pad, line_length);
fix->line_length = line_length;
- pr_err("fix->line_length = %d\n",fix->line_length);
+ pr_err("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
@@ -377,13 +377,13 @@ static int lynxfb_ops_set_par(struct fb_info * info)
pr_err("pixel bpp format not satisfied\n.");
return ret;
}
- ret = crtc->proc_setMode(crtc,var,fix);
+ ret = crtc->proc_setMode(crtc, var, fix);
if(!ret)
- ret = output->proc_setMode(output,var,fix);
+ ret = output->proc_setMode(output, var, fix);
return ret;
}
-static inline unsigned int chan_to_field(unsigned int chan,struct fb_bitfield * bf)
+static inline unsigned int chan_to_field(unsigned int chan, struct fb_bitfield * bf)
{
chan &= 0xffff;
chan >>= 16 - bf->length;
@@ -461,7 +461,7 @@ static int lynxfb_resume(struct pci_dev* pdev)
console_lock();
if((ret = pci_set_power_state(pdev, PCI_D0)) != 0){
- pr_err("error:%d occured in pci_set_power_state\n",ret);
+ pr_err("error:%d occured in pci_set_power_state\n", ret);
return ret;
}
@@ -469,7 +469,7 @@ static int lynxfb_resume(struct pci_dev* pdev)
if(pdev->dev.power.power_state.event != PM_EVENT_FREEZE){
pci_restore_state(pdev);
if ((ret = pci_enable_device(pdev)) != 0){
- pr_err("error:%d occured in pci_enable_device\n",ret);
+ pr_err("error:%d occured in pci_enable_device\n", ret);
return ret;
}
pci_set_master(pdev);
@@ -477,7 +477,7 @@ static int lynxfb_resume(struct pci_dev* pdev)
if(share->resume)
(*share->resume)(share);
- hw_sm750_inithw(share,pdev);
+ hw_sm750_inithw(share, pdev);
info = share->fbinfo[0];
@@ -487,7 +487,7 @@ static int lynxfb_resume(struct pci_dev* pdev)
crtc = &par->crtc;
cursor = &crtc->cursor;
memset(cursor->vstart, 0x0, cursor->size);
- memset(crtc->vScreen,0x0,crtc->vidmem_size);
+ memset(crtc->vScreen, 0x0, crtc->vidmem_size);
lynxfb_ops_set_par(info);
fb_set_suspend(info, 0);
}
@@ -499,7 +499,7 @@ static int lynxfb_resume(struct pci_dev* pdev)
crtc = &par->crtc;
cursor = &crtc->cursor;
memset(cursor->vstart, 0x0, cursor->size);
- memset(crtc->vScreen,0x0,crtc->vidmem_size);
+ memset(crtc->vScreen, 0x0, crtc->vidmem_size);
lynxfb_ops_set_par(info);
fb_set_suspend(info, 0);
}
@@ -510,7 +510,7 @@ static int lynxfb_resume(struct pci_dev* pdev)
}
#endif
-static int lynxfb_ops_check_var(struct fb_var_screeninfo* var,struct fb_info* info)
+static int lynxfb_ops_check_var(struct fb_var_screeninfo* var, struct fb_info* info)
{
struct lynxfb_par * par;
struct lynxfb_crtc * crtc;
@@ -539,7 +539,7 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo* var,struct fb_info* in
case 32:
break;
default:
- pr_err("bpp %d not supported\n",var->bits_per_pixel);
+ pr_err("bpp %d not supported\n", var->bits_per_pixel);
ret = -EINVAL;
goto exit;
}
@@ -588,24 +588,24 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo* var,struct fb_info* in
request = var->xres_virtual * (var->bits_per_pixel >> 3);
/* defaulty crtc->channel go with par->index */
- request = PADDING(crtc->line_pad,request);
+ request = PADDING(crtc->line_pad, request);
request = request * var->yres_virtual;
if(crtc->vidmem_size < request){
pr_err("not enough video memory for mode\n");
return -ENOMEM;
}
- ret = output->proc_checkMode(output,var);
+ ret = output->proc_checkMode(output, var);
if(!ret)
- ret = crtc->proc_checkMode(crtc,var);
+ ret = crtc->proc_checkMode(crtc, var);
exit:
return ret;
}
-static int lynxfb_ops_setcolreg(unsigned regno,unsigned red,
- unsigned green,unsigned blue,
- unsigned transp,struct fb_info * info)
+static int lynxfb_ops_setcolreg(unsigned regno, unsigned red,
+ unsigned green, unsigned blue,
+ unsigned transp, struct fb_info * info)
{
struct lynxfb_par * par;
struct lynxfb_crtc * crtc;
@@ -619,7 +619,7 @@ static int lynxfb_ops_setcolreg(unsigned regno,unsigned red,
//pr_debug("regno=%d,red=%d,green=%d,blue=%d\n",regno,red,green,blue);
if(regno > 256){
- pr_err("regno = %d\n",regno);
+ pr_err("regno = %d\n", regno);
return -EINVAL;
}
@@ -631,7 +631,7 @@ static int lynxfb_ops_setcolreg(unsigned regno,unsigned red,
red >>= 8;
green >>= 8;
blue >>= 8;
- ret = crtc->proc_setColReg(crtc,regno,red,green,blue);
+ ret = crtc->proc_setColReg(crtc, regno, red, green, blue);
goto exit;
}
@@ -643,9 +643,9 @@ static int lynxfb_ops_setcolreg(unsigned regno,unsigned red,
var->bits_per_pixel = 32 ||
var->bits_per_pixel = 24)
{
- val = chan_to_field(red,&var->red);
- val |= chan_to_field(green,&var->green);
- val |= chan_to_field(blue,&var->blue);
+ val = chan_to_field(red, &var->red);
+ val |= chan_to_field(green, &var->green);
+ val |= chan_to_field(blue, &var->blue);
par->pseudo_palette[regno] = val;
goto exit;
}
@@ -657,15 +657,15 @@ exit:
return ret;
}
-static int lynxfb_ops_blank(int blank,struct fb_info* info)
+static int lynxfb_ops_blank(int blank, struct fb_info* info)
{
struct lynxfb_par * par;
struct lynxfb_output * output;
- pr_debug("blank = %d.\n",blank);
+ pr_debug("blank = %d.\n", blank);
par = info->par;
output = &par->output;
- return output->proc_setBLANK(output,blank);
+ return output->proc_setBLANK(output, blank);
}
static int sm750fb_set_drv(struct lynxfb_par * par)
@@ -679,7 +679,7 @@ static int sm750fb_set_drv(struct lynxfb_par * par)
ret = 0;
share = par->share;
- spec_share = container_of(share,struct sm750_share,share);
+ spec_share = container_of(share, struct sm750_share, share);
output = &par->output;
crtc = &par->crtc;
@@ -769,7 +769,7 @@ static struct fb_ops lynxfb_ops={
};
-static int lynxfb_set_fbinfo(struct fb_info* info,int index)
+static int lynxfb_set_fbinfo(struct fb_info* info, int index)
{
int i;
struct lynxfb_par * par;
@@ -780,9 +780,9 @@ static int lynxfb_set_fbinfo(struct fb_info* info,int index)
struct fb_fix_screeninfo * fix;
const struct fb_videomode * pdb[] = {
- lynx750_ext, NULL,vesa_modes,
+ lynx750_ext, NULL, vesa_modes,
};
- int cdb[] = {ARRAY_SIZE(lynx750_ext),0,VESA_MODEDB_SIZE};
+ int cdb[] = {ARRAY_SIZE(lynx750_ext), 0, VESA_MODEDB_SIZE};
static const char * mdb_desc[] ={
"driver prepared modes",
"kernel prepared default modedb",
@@ -792,10 +792,10 @@ static int lynxfb_set_fbinfo(struct fb_info* info,int index)
static const char * fixId[2] {
- "sm750_fb1","sm750_fb2",
+ "sm750_fb1", "sm750_fb2",
};
- int ret,line_length;
+ int ret, line_length;
ret = 0;
par = (struct lynxfb_par *)info->par;
@@ -817,7 +817,7 @@ static int lynxfb_set_fbinfo(struct fb_info* info,int index)
crtc->cursor.offset = crtc->oScreen + crtc->vidmem_size - 1024;
crtc->cursor.mmio = share->pvReg + 0x800f0 + (int)crtc->channel * 0x140;
- pr_info("crtc->cursor.mmio = %p\n",crtc->cursor.mmio);
+ pr_info("crtc->cursor.mmio = %p\n", crtc->cursor.mmio);
crtc->cursor.maxH = crtc->cursor.maxW = 64;
crtc->cursor.size = crtc->cursor.maxH*crtc->cursor.maxW*2/8;
crtc->cursor.disable = hw_cursor_disable;
@@ -855,8 +855,8 @@ static int lynxfb_set_fbinfo(struct fb_info* info,int index)
for(i=0;i<3;i++){
- ret = fb_find_mode(var,info,g_fbmode[index],
- pdb[i],cdb[i],NULL,8);
+ ret = fb_find_mode(var, info, g_fbmode[index],
+ pdb[i], cdb[i], NULL, 8);
if(ret = 1){
pr_info("success! use specified mode:%s in %s\n",
@@ -874,7 +874,7 @@ static int lynxfb_set_fbinfo(struct fb_info* info,int index)
}else if(ret = 4){
pr_warn("fall back to any valid mode\n");
}else{
- pr_warn("ret = %d,fb_find_mode failed,with %s\n",ret,mdb_desc[i]);
+ pr_warn("ret = %d,fb_find_mode failed,with %s\n", ret, mdb_desc[i]);
}
}
@@ -888,8 +888,8 @@ static int lynxfb_set_fbinfo(struct fb_info* info,int index)
xoffset=%d\n\
yoffset=%d\n\
bits_per_pixel=%d\n \
- ...\n",var->xres,var->yres,var->xres_virtual,var->yres_virtual,
- var->xoffset,var->yoffset,var->bits_per_pixel);
+ ...\n", var->xres, var->yres, var->xres_virtual, var->yres_virtual,
+ var->xoffset, var->yoffset, var->bits_per_pixel);
/* set par */
par->info = info;
@@ -900,7 +900,7 @@ static int lynxfb_set_fbinfo(struct fb_info* info,int index)
info->pseudo_palette = &par->pseudo_palette[0];
info->screen_base = crtc->vScreen;
- pr_debug("screen_base vaddr = %p\n",info->screen_base);
+ pr_debug("screen_base vaddr = %p\n", info->screen_base);
info->screen_size = line_length * var->yres_virtual;
info->flags = FBINFO_FLAG_DEFAULT|0;
@@ -912,11 +912,11 @@ static int lynxfb_set_fbinfo(struct fb_info* info,int index)
fix->ywrapstep = crtc->ywrapstep;
fix->accel = FB_ACCEL_SMI;
- strlcpy(fix->id,fixId[index],sizeof(fix->id));
+ strlcpy(fix->id, fixId[index], sizeof(fix->id));
fix->smem_start = crtc->oScreen + share->vidmem_start;
- pr_info("fix->smem_start = %lx\n",fix->smem_start);
+ pr_info("fix->smem_start = %lx\n", fix->smem_start);
/* according to mmap experiment from user space application,
* fix->mmio_len should not larger than virtual size
* (xres_virtual x yres_virtual x ByPP)
@@ -924,13 +924,13 @@ static int lynxfb_set_fbinfo(struct fb_info* info,int index)
* data into the bound over virtual size
* */
fix->smem_len = crtc->vidmem_size;
- pr_info("fix->smem_len = %x\n",fix->smem_len);
+ pr_info("fix->smem_len = %x\n", fix->smem_len);
info->screen_size = fix->smem_len;
fix->line_length = line_length;
fix->mmio_start = share->vidreg_start;
- pr_info("fix->mmio_start = %lx\n",fix->mmio_start);
+ pr_info("fix->mmio_start = %lx\n", fix->mmio_start);
fix->mmio_len = share->vidreg_size;
- pr_info("fix->mmio_len = %x\n",fix->mmio_len);
+ pr_info("fix->mmio_len = %x\n", fix->mmio_len);
switch(var->bits_per_pixel)
{
case 8:
@@ -948,28 +948,28 @@ static int lynxfb_set_fbinfo(struct fb_info* info,int index)
var->vmode = FB_VMODE_NONINTERLACED;
pr_debug("#1 show info->cmap : \nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n",
- info->cmap.start,info->cmap.len,
- info->cmap.red,info->cmap.green,info->cmap.blue,
+ info->cmap.start, info->cmap.len,
+ info->cmap.red, info->cmap.green, info->cmap.blue,
info->cmap.transp);
- if((ret = fb_alloc_cmap(&info->cmap,256,0)) < 0){
+ if((ret = fb_alloc_cmap(&info->cmap, 256, 0)) < 0){
pr_err("Could not allcate memory for cmap.\n");
goto exit;
}
pr_debug("#2 show info->cmap : \nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n",
- info->cmap.start,info->cmap.len,
- info->cmap.red,info->cmap.green,info->cmap.blue,
+ info->cmap.start, info->cmap.len,
+ info->cmap.red, info->cmap.green, info->cmap.blue,
info->cmap.transp);
exit:
- lynxfb_ops_check_var(var,info);
+ lynxfb_ops_check_var(var, info);
// lynxfb_ops_set_par(info);
return ret;
}
/* chip specific g_option configuration routine */
-static void sm750fb_setup(struct lynx_share * share,char * src)
+static void sm750fb_setup(struct lynx_share * share, char * src)
{
struct sm750_share * spec_share;
char * opt;
@@ -979,7 +979,7 @@ static void sm750fb_setup(struct lynx_share * share,char * src)
int swap;
- spec_share = container_of(share,struct sm750_share,share);
+ spec_share = container_of(share, struct sm750_share, share);
#ifdef CAP_EXPENSIION
exp_res = NULL;
#endif
@@ -1000,45 +1000,45 @@ static void sm750fb_setup(struct lynx_share * share,char * src)
goto NO_PARAM;
}
- while((opt = strsep(&src,":")) != NULL && *opt != 0){
- pr_err("opt=%s\n",opt);
- pr_err("src=%s\n",src);
+ while((opt = strsep(&src, ":")) != NULL && *opt != 0){
+ pr_err("opt=%s\n", opt);
+ pr_err("src=%s\n", src);
- if(!strncmp(opt,"swap",strlen("swap")))
+ if(!strncmp(opt, "swap", strlen("swap")))
swap = 1;
- else if(!strncmp(opt,"nocrt",strlen("nocrt")))
+ else if(!strncmp(opt, "nocrt", strlen("nocrt")))
spec_share->state.nocrt = 1;
- else if(!strncmp(opt,"36bit",strlen("36bit")))
+ else if(!strncmp(opt, "36bit", strlen("36bit")))
spec_share->state.pnltype = sm750_doubleTFT;
- else if(!strncmp(opt,"18bit",strlen("18bit")))
+ else if(!strncmp(opt, "18bit", strlen("18bit")))
spec_share->state.pnltype = sm750_dualTFT;
- else if(!strncmp(opt,"24bit",strlen("24bit")))
+ else if(!strncmp(opt, "24bit", strlen("24bit")))
spec_share->state.pnltype = sm750_24TFT;
#ifdef CAP_EXPANSION
- else if(!strncmp(opt,"exp:",strlen("exp:")))
+ else if(!strncmp(opt, "exp:", strlen("exp:")))
exp_res = opt + strlen("exp:");
#endif
- else if(!strncmp(opt,"nohwc0",strlen("nohwc0")))
+ else if(!strncmp(opt, "nohwc0", strlen("nohwc0")))
g_hwcursor &= ~0x1;
- else if(!strncmp(opt,"nohwc1",strlen("nohwc1")))
+ else if(!strncmp(opt, "nohwc1", strlen("nohwc1")))
g_hwcursor &= ~0x2;
- else if(!strncmp(opt,"nohwc",strlen("nohwc")))
+ else if(!strncmp(opt, "nohwc", strlen("nohwc")))
g_hwcursor = 0;
else
{
if(!g_fbmode[0]){
g_fbmode[0] = opt;
- pr_info("find fbmode0 : %s\n",g_fbmode[0]);
+ pr_info("find fbmode0 : %s\n", g_fbmode[0]);
}else if(!g_fbmode[1]){
g_fbmode[1] = opt;
- pr_info("find fbmode1 : %s\n",g_fbmode[1]);
+ pr_info("find fbmode1 : %s\n", g_fbmode[1]);
}else{
pr_warn("How many view you wann set?\n");
}
}
}
#ifdef CAP_EXPANSION
- if(getExpRes(exp_res,&spec_share->state.xLCD,&spec_share->state.yLCD))
+ if(getExpRes(exp_res, &spec_share->state.xLCD, &spec_share->state.yLCD))
{
/* seems exp_res is not valid*/
spec_share->state.xLCD = spec_share->state.yLCD = 0;
@@ -1070,7 +1070,7 @@ NO_PARAM:
static int lynxfb_pci_probe(struct pci_dev * pdev,
const struct pci_device_id * ent)
{
- struct fb_info * info[] = {NULL,NULL};
+ struct fb_info * info[] = {NULL, NULL};
struct lynx_share * share = NULL;
struct sm750_share *spec_share = NULL;
@@ -1086,9 +1086,9 @@ static int lynxfb_pci_probe(struct pci_dev * pdev,
/* though offset of share in sm750_share is 0,
* we use this marcro as the same */
- spec_offset = offsetof(struct sm750_share,share);
+ spec_offset = offsetof(struct sm750_share, share);
- spec_share = kzalloc(sizeof(*spec_share),GFP_KERNEL);
+ spec_share = kzalloc(sizeof(*spec_share), GFP_KERNEL);
if(!spec_share){
pr_err("Could not allocate memory for share.\n");
goto err_share;
@@ -1100,7 +1100,7 @@ static int lynxfb_pci_probe(struct pci_dev * pdev,
share->devid = pdev->device;
share->revid = pdev->revision;
- pr_info("share->revid = %02x\n",share->revid);
+ pr_info("share->revid = %02x\n", share->revid);
share->pdev = pdev;
#ifdef CONFIG_MTRR
share->mtrr_off = g_nomtrr;
@@ -1126,10 +1126,10 @@ static int lynxfb_pci_probe(struct pci_dev * pdev,
}
/* call chip specific setup routine */
- sm750fb_setup(share,g_settings);
+ sm750fb_setup(share, g_settings);
/* call chip specific mmap routine */
- if(hw_sm750_map(share,pdev)){
+ if(hw_sm750_map(share, pdev)){
pr_err("Memory map failed\n");
goto err_map;
}
@@ -1139,7 +1139,7 @@ static int lynxfb_pci_probe(struct pci_dev * pdev,
pr_info("enable mtrr\n");
share->mtrr.vram = mtrr_add(share->vidmem_start,
share->vidmem_size,
- MTRR_TYPE_WRCOMB,1);
+ MTRR_TYPE_WRCOMB, 1);
if(share->mtrr.vram < 0){
/* don't block driver with the failure of MTRR */
@@ -1151,22 +1151,22 @@ static int lynxfb_pci_probe(struct pci_dev * pdev,
}
#endif
- memset(share->pvMem,0,share->vidmem_size);
+ memset(share->pvMem, 0, share->vidmem_size);
- pr_info("sm%3x mmio address = %p\n",share->devid,share->pvReg);
+ pr_info("sm%3x mmio address = %p\n", share->devid, share->pvReg);
- pci_set_drvdata(pdev,share);
+ pci_set_drvdata(pdev, share);
/* call chipInit routine */
- hw_sm750_inithw(share,pdev);
+ hw_sm750_inithw(share, pdev);
/* allocate frame buffer info structor according to g_dualview */
fbidx = 0;
ALLOC_FB:
- info[fbidx] = framebuffer_alloc(sizeof(struct lynxfb_par),&pdev->dev);
+ info[fbidx] = framebuffer_alloc(sizeof(struct lynxfb_par), &pdev->dev);
if(!info[fbidx])
{
- pr_err("Could not allocate framebuffer #%d.\n",fbidx);
+ pr_err("Could not allocate framebuffer #%d.\n", fbidx);
if(fbidx = 0)
goto err_info0_alloc;
else
@@ -1176,14 +1176,14 @@ ALLOC_FB:
{
struct lynxfb_par * par;
int errno;
- pr_info("framebuffer #%d alloc okay\n",fbidx);
+ pr_info("framebuffer #%d alloc okay\n", fbidx);
share->fbinfo[fbidx] = info[fbidx];
par = info[fbidx]->par;
par->share = share;
/* set fb_info structure */
- if(lynxfb_set_fbinfo(info[fbidx],fbidx)){
- pr_err("Failed to initial fb_info #%d.\n",fbidx);
+ if(lynxfb_set_fbinfo(info[fbidx], fbidx)){
+ pr_err("Failed to initial fb_info #%d.\n", fbidx);
if(fbidx = 0)
goto err_info0_set;
else
@@ -1191,16 +1191,16 @@ ALLOC_FB:
}
/* register frame buffer*/
- pr_info("Ready to register framebuffer #%d.\n",fbidx);
+ pr_info("Ready to register framebuffer #%d.\n", fbidx);
errno = register_framebuffer(info[fbidx]);
if (errno < 0) {
- pr_err("Failed to register fb_info #%d. err %d\n",fbidx, errno);
+ pr_err("Failed to register fb_info #%d. err %d\n", fbidx, errno);
if(fbidx = 0)
goto err_register0;
else
goto err_register1;
}
- pr_info("Accomplished register framebuffer #%d.\n",fbidx);
+ pr_info("Accomplished register framebuffer #%d.\n", fbidx);
}
/* no dual view by far */
@@ -1252,16 +1252,16 @@ static void __exit lynxfb_pci_remove(struct pci_dev * pdev)
}
#ifdef CONFIG_MTRR
if(share->mtrr.vram_added)
- mtrr_del(share->mtrr.vram,share->vidmem_start,share->vidmem_size);
+ mtrr_del(share->mtrr.vram, share->vidmem_start, share->vidmem_size);
#endif
// pci_release_regions(pdev);
iounmap(share->pvReg);
iounmap(share->pvMem);
- spec_share = container_of(share,struct sm750_share,share);
+ spec_share = container_of(share, struct sm750_share, share);
kfree(g_settings);
kfree(spec_share);
- pci_set_drvdata(pdev,NULL);
+ pci_set_drvdata(pdev, NULL);
}
static int __init lynxfb_setup(char * options)
@@ -1275,7 +1275,7 @@ static int __init lynxfb_setup(char * options)
return 0;
}
- pr_info("options:%s\n",options);
+ pr_info("options:%s\n", options);
len = strlen(options) + 1;
g_settings = kzalloc(len, GFP_KERNEL);
@@ -1292,20 +1292,20 @@ static int __init lynxfb_setup(char * options)
strsep() updates @options to pointer after the first found token
it also returns the pointer ahead the token.
*/
- while((opt = strsep(&options,":"))!=NULL)
+ while((opt = strsep(&options, ":"))!=NULL)
{
/* options that mean for any lynx chips are configured here */
- if(!strncmp(opt,"noaccel",strlen("noaccel")))
+ if(!strncmp(opt, "noaccel", strlen("noaccel")))
g_noaccel = 1;
#ifdef CONFIG_MTRR
- else if(!strncmp(opt,"nomtrr",strlen("nomtrr")))
+ else if(!strncmp(opt, "nomtrr", strlen("nomtrr")))
g_nomtrr = 1;
#endif
- else if(!strncmp(opt,"dual",strlen("dual")))
+ else if(!strncmp(opt, "dual", strlen("dual")))
g_dualview = 1;
else
{
- strcat(tmp,opt);
+ strcat(tmp, opt);
tmp += strlen(opt);
if(options != NULL)
*tmp++ = ':';
@@ -1315,7 +1315,7 @@ static int __init lynxfb_setup(char * options)
}
/* misc g_settings are transport to chip specific routines */
- pr_info("parameter left for chip specific analysis:%s\n",g_settings);
+ pr_info("parameter left for chip specific analysis:%s\n", g_settings);
return 0;
}
@@ -1324,7 +1324,7 @@ static struct pci_device_id smi_pci_table[] = {
{0,}
};
-MODULE_DEVICE_TABLE(pci,smi_pci_table);
+MODULE_DEVICE_TABLE(pci, smi_pci_table);
static struct pci_driver lynxfb_driver = {
.name = "sm750fb",
@@ -1346,7 +1346,7 @@ static int __init lynxfb_init(void)
#ifdef MODULE
option = g_option;
#else
- if(fb_get_options("sm750fb",&option))
+ if(fb_get_options("sm750fb", &option))
return -ENODEV;
#endif
@@ -1362,7 +1362,7 @@ static void __exit lynxfb_exit(void)
}
module_exit(lynxfb_exit);
-module_param(g_option,charp,S_IRUGO);
+module_param(g_option, charp, S_IRUGO);
MODULE_PARM_DESC(g_option,
"\n\t\tCommon options:\n"
--
2.3.3
^ permalink raw reply related
* [PATCH 03/13] staging: sm750: move '{' to previous line
From: Michel von Czettritz @ 2015-03-22 23:11 UTC (permalink / raw)
To: linux-fbdev
Fix checkpatch.pl error:
"ERROR: that open brace { should be on the previous line"
Signed-off-by: Michel von Czettritz <michel.von.czettritz@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 50 +++++++++++++----------------------------
1 file changed, 16 insertions(+), 34 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 83c81d2..24e7b68 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -171,8 +171,7 @@ static int lynxfb_ops_cursor(struct fb_info* info, struct fb_cursor* fbcursor)
}
- if(fbcursor->set & (FB_CUR_SETSHAPE | FB_CUR_SETIMAGE))
- {
+ if(fbcursor->set & (FB_CUR_SETSHAPE | FB_CUR_SETIMAGE)) {
cursor->setData(cursor,
fbcursor->rop,
fbcursor->image.data,
@@ -258,13 +257,10 @@ static void lynxfb_ops_imageblit(struct fb_info*info, const struct fb_image* ima
if(image->depth = 1){
if(info->fix.visual = FB_VISUAL_TRUECOLOR ||
- info->fix.visual = FB_VISUAL_DIRECTCOLOR)
- {
+ info->fix.visual = FB_VISUAL_DIRECTCOLOR) {
fgcol = ((u32*)info->pseudo_palette)[image->fg_color];
bgcol = ((u32*)info->pseudo_palette)[image->bg_color];
- }
- else
- {
+ } else {
fgcol = image->fg_color;
bgcol = image->bg_color;
}
@@ -626,8 +622,7 @@ static int lynxfb_ops_setcolreg(unsigned regno, unsigned red,
if(info->var.grayscale)
red = green = blue = (red * 77 + green * 151 + blue * 28) >> 8;
- if(var->bits_per_pixel = 8 && info->fix.visual = FB_VISUAL_PSEUDOCOLOR)
- {
+ if(var->bits_per_pixel = 8 && info->fix.visual = FB_VISUAL_PSEUDOCOLOR) {
red >>= 8;
green >>= 8;
blue >>= 8;
@@ -636,13 +631,11 @@ static int lynxfb_ops_setcolreg(unsigned regno, unsigned red,
}
- if(info->fix.visual = FB_VISUAL_TRUECOLOR && regno < 256 )
- {
+ if(info->fix.visual = FB_VISUAL_TRUECOLOR && regno < 256 ) {
u32 val;
if(var->bits_per_pixel = 16 ||
var->bits_per_pixel = 32 ||
- var->bits_per_pixel = 24)
- {
+ var->bits_per_pixel = 24) {
val = chan_to_field(red, &var->red);
val |= chan_to_field(green, &var->green);
val |= chan_to_field(blue, &var->blue);
@@ -705,8 +698,7 @@ static int sm750fb_set_drv(struct lynxfb_par * par)
output->clear = hw_sm750_output_clear;
/* chip specific phase */
share->accel.de_wait = (share->revid = SM750LE_REVISION_ID)?hw_sm750le_deWait: hw_sm750_deWait;
- switch (spec_share->state.dataflow)
- {
+ switch (spec_share->state.dataflow) {
case sm750_simul_pri:
output->paths = sm750_pnc;
crtc->channel = sm750_primary;
@@ -790,8 +782,7 @@ static int lynxfb_set_fbinfo(struct fb_info* info, int index)
};
- static const char * fixId[2]- {
+ static const char * fixId[2] = {
"sm750_fb1", "sm750_fb2",
};
@@ -931,8 +922,7 @@ static int lynxfb_set_fbinfo(struct fb_info* info, int index)
pr_info("fix->mmio_start = %lx\n", fix->mmio_start);
fix->mmio_len = share->vidreg_size;
pr_info("fix->mmio_len = %x\n", fix->mmio_len);
- switch(var->bits_per_pixel)
- {
+ switch(var->bits_per_pixel) {
case 8:
fix->visual = FB_VISUAL_PSEUDOCOLOR;
break;
@@ -1024,8 +1014,7 @@ static void sm750fb_setup(struct lynx_share * share, char * src)
g_hwcursor &= ~0x2;
else if(!strncmp(opt, "nohwc", strlen("nohwc")))
g_hwcursor = 0;
- else
- {
+ else {
if(!g_fbmode[0]){
g_fbmode[0] = opt;
pr_info("find fbmode0 : %s\n", g_fbmode[0]);
@@ -1038,8 +1027,7 @@ static void sm750fb_setup(struct lynx_share * share, char * src)
}
}
#ifdef CAP_EXPANSION
- if(getExpRes(exp_res, &spec_share->state.xLCD, &spec_share->state.yLCD))
- {
+ if(getExpRes(exp_res, &spec_share->state.xLCD, &spec_share->state.yLCD)) {
/* seems exp_res is not valid*/
spec_share->state.xLCD = spec_share->state.yLCD = 0;
}
@@ -1047,8 +1035,7 @@ static void sm750fb_setup(struct lynx_share * share, char * src)
NO_PARAM:
if(share->revid != SM750LE_REVISION_ID){
- if(share->dual)
- {
+ if(share->dual) {
if(swap)
spec_share->state.dataflow = sm750_dual_swap;
else
@@ -1164,16 +1151,13 @@ static int lynxfb_pci_probe(struct pci_dev * pdev,
fbidx = 0;
ALLOC_FB:
info[fbidx] = framebuffer_alloc(sizeof(struct lynxfb_par), &pdev->dev);
- if(!info[fbidx])
- {
+ if(!info[fbidx]) {
pr_err("Could not allocate framebuffer #%d.\n", fbidx);
if(fbidx = 0)
goto err_info0_alloc;
else
goto err_info1_alloc;
- }
- else
- {
+ } else {
struct lynxfb_par * par;
int errno;
pr_info("framebuffer #%d alloc okay\n", fbidx);
@@ -1292,8 +1276,7 @@ static int __init lynxfb_setup(char * options)
strsep() updates @options to pointer after the first found token
it also returns the pointer ahead the token.
*/
- while((opt = strsep(&options, ":"))!=NULL)
- {
+ while((opt = strsep(&options, ":"))!=NULL) {
/* options that mean for any lynx chips are configured here */
if(!strncmp(opt, "noaccel", strlen("noaccel")))
g_noaccel = 1;
@@ -1303,8 +1286,7 @@ static int __init lynxfb_setup(char * options)
#endif
else if(!strncmp(opt, "dual", strlen("dual")))
g_dualview = 1;
- else
- {
+ else {
strcat(tmp, opt);
tmp += strlen(opt);
if(options != NULL)
--
2.3.3
^ permalink raw reply related
* [PATCH 04/13] staging: sm750: fix whitespace around braces
From: Michel von Czettritz @ 2015-03-22 23:11 UTC (permalink / raw)
To: linux-fbdev
Fix multiple similar checkpatch.pl errors:
- "ERROR: space required before the open parenthesis '('"
- "ERROR: space required before the open brace '{'"
- "ERROR: space prohibited after that open parenthesis '('"
- "ERROR: space prohibited before that close parenthesis ')'"
Signed-off-by: Michel von Czettritz <michel.von.czettritz@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 202 ++++++++++++++++++++--------------------
1 file changed, 101 insertions(+), 101 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 24e7b68..8469746 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -39,9 +39,9 @@ int smi_indent = 0;
* #endif
*/
-typedef void (*PROC_SPEC_SETUP)(struct lynx_share*,char *);
-typedef int (*PROC_SPEC_MAP)(struct lynx_share*,struct pci_dev*);
-typedef int (*PROC_SPEC_INITHW)(struct lynx_share*,struct pci_dev*);
+typedef void (*PROC_SPEC_SETUP)(struct lynx_share*, char *);
+typedef int (*PROC_SPEC_MAP)(struct lynx_share*, struct pci_dev*);
+typedef int (*PROC_SPEC_INITHW)(struct lynx_share*, struct pci_dev*);
/* common var for all device */
@@ -58,18 +58,18 @@ static char * g_option = NULL;
/* if not use spin_lock,system will die if user load driver
* and immediatly unload driver frequently (dual)*/
-static inline void myspin_lock(spinlock_t * sl){
+static inline void myspin_lock(spinlock_t * sl) {
struct lynx_share * share;
share = container_of(sl, struct lynx_share, slock);
- if(share->dual){
+ if (share->dual) {
spin_lock(sl);
}
}
-static inline void myspin_unlock(spinlock_t * sl){
+static inline void myspin_unlock(spinlock_t * sl) {
struct lynx_share * share;
share = container_of(sl, struct lynx_share, slock);
- if(share->dual){
+ if (share->dual) {
spin_unlock(sl);
}
}
@@ -140,23 +140,23 @@ static int lynxfb_ops_cursor(struct fb_info* info, struct fb_cursor* fbcursor)
crtc = &par->crtc;
cursor = &crtc->cursor;
- if(fbcursor->image.width > cursor->maxW ||
+ if (fbcursor->image.width > cursor->maxW ||
fbcursor->image.height > cursor->maxH ||
- fbcursor->image.depth > 1){
+ fbcursor->image.depth > 1) {
return -ENXIO;
}
cursor->disable(cursor);
- if(fbcursor->set & FB_CUR_SETSIZE){
+ if (fbcursor->set & FB_CUR_SETSIZE) {
cursor->setSize(cursor, fbcursor->image.width, fbcursor->image.height);
}
- if(fbcursor->set & FB_CUR_SETPOS){
+ if (fbcursor->set & FB_CUR_SETPOS) {
cursor->setPos(cursor, fbcursor->image.dx - info->var.xoffset,
fbcursor->image.dy - info->var.yoffset);
}
- if(fbcursor->set & FB_CUR_SETCMAP){
+ if (fbcursor->set & FB_CUR_SETCMAP) {
/* get the 16bit color of kernel means */
u16 fg, bg;
fg = ((info->cmap.red[fbcursor->image.fg_color] & 0xf800))|
@@ -171,14 +171,14 @@ static int lynxfb_ops_cursor(struct fb_info* info, struct fb_cursor* fbcursor)
}
- if(fbcursor->set & (FB_CUR_SETSHAPE | FB_CUR_SETIMAGE)) {
+ if (fbcursor->set & (FB_CUR_SETSHAPE | FB_CUR_SETIMAGE)) {
cursor->setData(cursor,
fbcursor->rop,
fbcursor->image.data,
fbcursor->mask);
}
- if(fbcursor->enable){
+ if (fbcursor->enable) {
cursor->enable(cursor);
}
@@ -192,7 +192,7 @@ static void lynxfb_ops_fillrect(struct fb_info* info, const struct fb_fillrect*
unsigned int base, pitch, Bpp, rop;
u32 color;
- if(info->state != FBINFO_STATE_RUNNING){
+ if (info->state != FBINFO_STATE_RUNNING) {
return;
}
@@ -206,7 +206,7 @@ static void lynxfb_ops_fillrect(struct fb_info* info, const struct fb_fillrect*
Bpp = info->var.bits_per_pixel >> 3;
color = (Bpp = 1)?region->color:((u32*)info->pseudo_palette)[region->color];
- rop = ( region->rop != ROP_COPY ) ? HW_ROP2_XOR:HW_ROP2_COPY;
+ rop = (region->rop != ROP_COPY) ? HW_ROP2_XOR:HW_ROP2_COPY;
myspin_lock(&share->slock);
share->accel.de_fillrect(&share->accel,
@@ -255,8 +255,8 @@ static void lynxfb_ops_imageblit(struct fb_info*info, const struct fb_image* ima
pitch = info->fix.line_length;
Bpp = info->var.bits_per_pixel >> 3;
- if(image->depth = 1){
- if(info->fix.visual = FB_VISUAL_TRUECOLOR ||
+ if (image->depth = 1) {
+ if (info->fix.visual = FB_VISUAL_TRUECOLOR ||
info->fix.visual = FB_VISUAL_DIRECTCOLOR) {
fgcol = ((u32*)info->pseudo_palette)[image->fg_color];
bgcol = ((u32*)info->pseudo_palette)[image->bg_color];
@@ -286,7 +286,7 @@ static int lynxfb_ops_pan_display(struct fb_var_screeninfo *var,
int ret;
- if(!info)
+ if (!info)
return -EINVAL;
ret = 0;
@@ -308,7 +308,7 @@ static int lynxfb_ops_set_par(struct fb_info * info)
int ret;
unsigned int line_length;
- if(!info)
+ if (!info)
return -EINVAL;
ret = 0;
@@ -329,7 +329,7 @@ static int lynxfb_ops_set_par(struct fb_info * info)
* and these data should be set before setcolreg routine
* */
- switch(var->bits_per_pixel){
+ switch (var->bits_per_pixel) {
case 8:
fix->visual = FB_VISUAL_PSEUDOCOLOR;
var->red.offset = 0;
@@ -369,12 +369,12 @@ static int lynxfb_ops_set_par(struct fb_info * info)
var->height = var->width = -1;
var->accel_flags = 0;/*FB_ACCELF_TEXT;*/
- if(ret){
+ if (ret) {
pr_err("pixel bpp format not satisfied\n.");
return ret;
}
ret = crtc->proc_setMode(crtc, var, fix);
- if(!ret)
+ if (!ret)
ret = output->proc_setMode(output, var, fix);
return ret;
}
@@ -456,21 +456,21 @@ static int lynxfb_resume(struct pci_dev* pdev)
console_lock();
- if((ret = pci_set_power_state(pdev, PCI_D0)) != 0){
+ if ((ret = pci_set_power_state(pdev, PCI_D0)) != 0) {
pr_err("error:%d occured in pci_set_power_state\n", ret);
return ret;
}
- if(pdev->dev.power.power_state.event != PM_EVENT_FREEZE){
+ if (pdev->dev.power.power_state.event != PM_EVENT_FREEZE) {
pci_restore_state(pdev);
- if ((ret = pci_enable_device(pdev)) != 0){
+ if ((ret = pci_enable_device(pdev)) != 0) {
pr_err("error:%d occured in pci_enable_device\n", ret);
return ret;
}
pci_set_master(pdev);
}
- if(share->resume)
+ if (share->resume)
(*share->resume)(share);
hw_sm750_inithw(share, pdev);
@@ -478,7 +478,7 @@ static int lynxfb_resume(struct pci_dev* pdev)
info = share->fbinfo[0];
- if(info){
+ if (info) {
par = info->par;
crtc = &par->crtc;
cursor = &crtc->cursor;
@@ -490,7 +490,7 @@ static int lynxfb_resume(struct pci_dev* pdev)
info = share->fbinfo[1];
- if(info){
+ if (info) {
par = info->par;
crtc = &par->crtc;
cursor = &crtc->cursor;
@@ -528,7 +528,7 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo* var, struct fb_info* i
var->bits_per_pixel);
- switch(var->bits_per_pixel){
+ switch (var->bits_per_pixel) {
case 8:
case 16:
case 24: /* support 24 bpp for only lynx712/722/720 */
@@ -540,7 +540,7 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo* var, struct fb_info* i
goto exit;
}
- switch(var->bits_per_pixel){
+ switch (var->bits_per_pixel) {
case 8:
info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
var->red.offset = 0;
@@ -586,13 +586,13 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo* var, struct fb_info* i
request = PADDING(crtc->line_pad, request);
request = request * var->yres_virtual;
- if(crtc->vidmem_size < request){
+ if (crtc->vidmem_size < request) {
pr_err("not enough video memory for mode\n");
return -ENOMEM;
}
ret = output->proc_checkMode(output, var);
- if(!ret)
+ if (!ret)
ret = crtc->proc_checkMode(crtc, var);
exit:
return ret;
@@ -614,15 +614,15 @@ static int lynxfb_ops_setcolreg(unsigned regno, unsigned red,
ret = 0;
//pr_debug("regno=%d,red=%d,green=%d,blue=%d\n",regno,red,green,blue);
- if(regno > 256){
+ if (regno > 256) {
pr_err("regno = %d\n", regno);
return -EINVAL;
}
- if(info->var.grayscale)
+ if (info->var.grayscale)
red = green = blue = (red * 77 + green * 151 + blue * 28) >> 8;
- if(var->bits_per_pixel = 8 && info->fix.visual = FB_VISUAL_PSEUDOCOLOR) {
+ if (var->bits_per_pixel = 8 && info->fix.visual = FB_VISUAL_PSEUDOCOLOR) {
red >>= 8;
green >>= 8;
blue >>= 8;
@@ -631,9 +631,9 @@ static int lynxfb_ops_setcolreg(unsigned regno, unsigned red,
}
- if(info->fix.visual = FB_VISUAL_TRUECOLOR && regno < 256 ) {
+ if (info->fix.visual = FB_VISUAL_TRUECOLOR && regno < 256) {
u32 val;
- if(var->bits_per_pixel = 16 ||
+ if (var->bits_per_pixel = 16 ||
var->bits_per_pixel = 32 ||
var->bits_per_pixel = 24) {
val = chan_to_field(red, &var->red);
@@ -713,12 +713,12 @@ static int sm750fb_set_drv(struct lynxfb_par * par)
crtc->vScreen = share->pvMem;
break;
case sm750_dual_normal:
- if(par->index = 0){
+ if (par->index = 0) {
output->paths = sm750_panel;
crtc->channel = sm750_primary;
crtc->oScreen = 0;
crtc->vScreen = share->pvMem;
- }else{
+ } else {
output->paths = sm750_crt;
crtc->channel = sm750_secondary;
/* not consider of padding stuffs for oScreen,need fix*/
@@ -727,12 +727,12 @@ static int sm750fb_set_drv(struct lynxfb_par * par)
}
break;
case sm750_dual_swap:
- if(par->index = 0){
+ if (par->index = 0) {
output->paths = sm750_panel;
crtc->channel = sm750_secondary;
crtc->oScreen = 0;
crtc->vScreen = share->pvMem;
- }else{
+ } else {
output->paths = sm750_crt;
crtc->channel = sm750_primary;
/* not consider of padding stuffs for oScreen,need fix*/
@@ -822,14 +822,14 @@ static int lynxfb_set_fbinfo(struct fb_info* info, int index)
crtc->cursor.share = share;
memset(crtc->cursor.vstart, 0, crtc->cursor.size);
- if(!g_hwcursor){
+ if (!g_hwcursor) {
lynxfb_ops.fb_cursor = NULL;
crtc->cursor.disable(&crtc->cursor);
}
/* set info->fbops, must be set before fb_find_mode */
- if(!share->accel_off){
+ if (!share->accel_off) {
/* use 2d acceleration */
lynxfb_ops.fb_fillrect = lynxfb_ops_fillrect;
lynxfb_ops.fb_copyarea = lynxfb_ops_copyarea;
@@ -837,34 +837,34 @@ static int lynxfb_set_fbinfo(struct fb_info* info, int index)
}
info->fbops = &lynxfb_ops;
- if(!g_fbmode[index]){
+ if (!g_fbmode[index]) {
g_fbmode[index] = g_def_fbmode;
- if(index)
+ if (index)
g_fbmode[index] = g_fbmode[0];
}
- for(i=0;i<3;i++){
+ for (i=0;i<3;i++) {
ret = fb_find_mode(var, info, g_fbmode[index],
pdb[i], cdb[i], NULL, 8);
- if(ret = 1){
+ if (ret = 1) {
pr_info("success! use specified mode:%s in %s\n",
g_fbmode[index],
mdb_desc[i]);
break;
- }else if(ret = 2){
+ } else if (ret = 2) {
pr_warn("use specified mode:%s in %s,with an ignored refresh rate\n",
g_fbmode[index],
mdb_desc[i]);
break;
- }else if(ret = 3){
+ } else if (ret = 3) {
pr_warn("wanna use default mode\n");
// break;
- }else if(ret = 4){
+ } else if (ret = 4) {
pr_warn("fall back to any valid mode\n");
- }else{
+ } else {
pr_warn("ret = %d,fb_find_mode failed,with %s\n", ret, mdb_desc[i]);
}
}
@@ -922,7 +922,7 @@ static int lynxfb_set_fbinfo(struct fb_info* info, int index)
pr_info("fix->mmio_start = %lx\n", fix->mmio_start);
fix->mmio_len = share->vidreg_size;
pr_info("fix->mmio_len = %x\n", fix->mmio_len);
- switch(var->bits_per_pixel) {
+ switch (var->bits_per_pixel) {
case 8:
fix->visual = FB_VISUAL_PSEUDOCOLOR;
break;
@@ -942,7 +942,7 @@ static int lynxfb_set_fbinfo(struct fb_info* info, int index)
info->cmap.red, info->cmap.green, info->cmap.blue,
info->cmap.transp);
- if((ret = fb_alloc_cmap(&info->cmap, 256, 0)) < 0){
+ if ((ret = fb_alloc_cmap(&info->cmap, 256, 0)) < 0) {
pr_err("Could not allcate memory for cmap.\n");
goto exit;
}
@@ -985,68 +985,68 @@ static void sm750fb_setup(struct lynx_share * share, char * src)
/*defaultly turn g_hwcursor on for both view */
g_hwcursor = 3;
- if(!src || !*src){
+ if (!src || !*src) {
pr_warn("no specific g_option.\n");
goto NO_PARAM;
}
- while((opt = strsep(&src, ":")) != NULL && *opt != 0){
+ while ((opt = strsep(&src, ":")) != NULL && *opt != 0) {
pr_err("opt=%s\n", opt);
pr_err("src=%s\n", src);
- if(!strncmp(opt, "swap", strlen("swap")))
+ if (!strncmp(opt, "swap", strlen("swap")))
swap = 1;
- else if(!strncmp(opt, "nocrt", strlen("nocrt")))
+ else if (!strncmp(opt, "nocrt", strlen("nocrt")))
spec_share->state.nocrt = 1;
- else if(!strncmp(opt, "36bit", strlen("36bit")))
+ else if (!strncmp(opt, "36bit", strlen("36bit")))
spec_share->state.pnltype = sm750_doubleTFT;
- else if(!strncmp(opt, "18bit", strlen("18bit")))
+ else if (!strncmp(opt, "18bit", strlen("18bit")))
spec_share->state.pnltype = sm750_dualTFT;
- else if(!strncmp(opt, "24bit", strlen("24bit")))
+ else if (!strncmp(opt, "24bit", strlen("24bit")))
spec_share->state.pnltype = sm750_24TFT;
#ifdef CAP_EXPANSION
- else if(!strncmp(opt, "exp:", strlen("exp:")))
+ else if (!strncmp(opt, "exp:", strlen("exp:")))
exp_res = opt + strlen("exp:");
#endif
- else if(!strncmp(opt, "nohwc0", strlen("nohwc0")))
+ else if (!strncmp(opt, "nohwc0", strlen("nohwc0")))
g_hwcursor &= ~0x1;
- else if(!strncmp(opt, "nohwc1", strlen("nohwc1")))
+ else if (!strncmp(opt, "nohwc1", strlen("nohwc1")))
g_hwcursor &= ~0x2;
- else if(!strncmp(opt, "nohwc", strlen("nohwc")))
+ else if (!strncmp(opt, "nohwc", strlen("nohwc")))
g_hwcursor = 0;
else {
- if(!g_fbmode[0]){
+ if (!g_fbmode[0]) {
g_fbmode[0] = opt;
pr_info("find fbmode0 : %s\n", g_fbmode[0]);
- }else if(!g_fbmode[1]){
+ } else if (!g_fbmode[1]) {
g_fbmode[1] = opt;
pr_info("find fbmode1 : %s\n", g_fbmode[1]);
- }else{
+ } else {
pr_warn("How many view you wann set?\n");
}
}
}
#ifdef CAP_EXPANSION
- if(getExpRes(exp_res, &spec_share->state.xLCD, &spec_share->state.yLCD)) {
+ if (getExpRes(exp_res, &spec_share->state.xLCD, &spec_share->state.yLCD)) {
/* seems exp_res is not valid*/
spec_share->state.xLCD = spec_share->state.yLCD = 0;
}
#endif
NO_PARAM:
- if(share->revid != SM750LE_REVISION_ID){
- if(share->dual) {
- if(swap)
+ if (share->revid != SM750LE_REVISION_ID) {
+ if (share->dual) {
+ if (swap)
spec_share->state.dataflow = sm750_dual_swap;
else
spec_share->state.dataflow = sm750_dual_normal;
- }else{
- if(swap)
+ } else {
+ if (swap)
spec_share->state.dataflow = sm750_simul_sec;
else
spec_share->state.dataflow = sm750_simul_pri;
}
- }else{
+ } else {
/* SM750LE only have one crt channel */
spec_share->state.dataflow = sm750_simul_sec;
/* sm750le do not have complex attributes*/
@@ -1066,7 +1066,7 @@ static int lynxfb_pci_probe(struct pci_dev * pdev,
/* enable device */
- if(pci_enable_device(pdev)){
+ if (pci_enable_device(pdev)) {
pr_err("can not enable device.\n");
goto err_enable;
}
@@ -1076,13 +1076,13 @@ static int lynxfb_pci_probe(struct pci_dev * pdev,
spec_offset = offsetof(struct sm750_share, share);
spec_share = kzalloc(sizeof(*spec_share), GFP_KERNEL);
- if(!spec_share){
+ if (!spec_share) {
pr_err("Could not allocate memory for share.\n");
goto err_share;
}
/* setting share structure */
- share = (struct lynx_share * )(&(spec_share->share));
+ share = (struct lynx_share *)(&(spec_share->share));
share->fbinfo[0] = share->fbinfo[1] = NULL;
share->devid = pdev->device;
share->revid = pdev->revision;
@@ -1098,7 +1098,7 @@ static int lynxfb_pci_probe(struct pci_dev * pdev,
share->dual = g_dualview;
spin_lock_init(&share->slock);
- if(!share->accel_off){
+ if (!share->accel_off) {
/* hook deInit and 2d routines, notes that below hw_xxx
* routine can work on most of lynx chips
* if some chip need specific function,please hook it in smXXX_set_drv
@@ -1108,7 +1108,7 @@ static int lynxfb_pci_probe(struct pci_dev * pdev,
share->accel.de_copyarea = hw_copyarea;
share->accel.de_imageblit = hw_imageblit;
pr_info("enable 2d acceleration\n");
- }else{
+ } else {
pr_info("disable 2d acceleration\n");
}
@@ -1116,22 +1116,22 @@ static int lynxfb_pci_probe(struct pci_dev * pdev,
sm750fb_setup(share, g_settings);
/* call chip specific mmap routine */
- if(hw_sm750_map(share, pdev)){
+ if (hw_sm750_map(share, pdev)) {
pr_err("Memory map failed\n");
goto err_map;
}
#ifdef CONFIG_MTRR
- if(!share->mtrr_off){
+ 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){
+ if (share->mtrr.vram < 0) {
/* don't block driver with the failure of MTRR */
pr_err("Unable to setup MTRR.\n");
- }else{
+ } else {
share->mtrr.vram_added = 1;
pr_info("MTRR added succesfully\n");
}
@@ -1151,9 +1151,9 @@ static int lynxfb_pci_probe(struct pci_dev * pdev,
fbidx = 0;
ALLOC_FB:
info[fbidx] = framebuffer_alloc(sizeof(struct lynxfb_par), &pdev->dev);
- if(!info[fbidx]) {
+ if (!info[fbidx]) {
pr_err("Could not allocate framebuffer #%d.\n", fbidx);
- if(fbidx = 0)
+ if (fbidx = 0)
goto err_info0_alloc;
else
goto err_info1_alloc;
@@ -1166,9 +1166,9 @@ ALLOC_FB:
par->share = share;
/* set fb_info structure */
- if(lynxfb_set_fbinfo(info[fbidx], fbidx)){
+ if (lynxfb_set_fbinfo(info[fbidx], fbidx)) {
pr_err("Failed to initial fb_info #%d.\n", fbidx);
- if(fbidx = 0)
+ if (fbidx = 0)
goto err_info0_set;
else
goto err_info1_set;
@@ -1179,7 +1179,7 @@ ALLOC_FB:
errno = register_framebuffer(info[fbidx]);
if (errno < 0) {
pr_err("Failed to register fb_info #%d. err %d\n", fbidx, errno);
- if(fbidx = 0)
+ if (fbidx = 0)
goto err_register0;
else
goto err_register1;
@@ -1189,7 +1189,7 @@ ALLOC_FB:
/* no dual view by far */
fbidx++;
- if(share->dual && fbidx < 2)
+ if (share->dual && fbidx < 2)
goto ALLOC_FB;
return 0;
@@ -1221,9 +1221,9 @@ static void __exit lynxfb_pci_remove(struct pci_dev * pdev)
cnt = 2;
share = pci_get_drvdata(pdev);
- while(cnt-- > 0){
+ while (cnt-- > 0) {
info = share->fbinfo[cnt];
- if(!info)
+ if (!info)
continue;
par = info->par;
@@ -1235,7 +1235,7 @@ static void __exit lynxfb_pci_remove(struct pci_dev * pdev)
framebuffer_release(info);
}
#ifdef CONFIG_MTRR
- if(share->mtrr.vram_added)
+ if (share->mtrr.vram_added)
mtrr_del(share->mtrr.vram, share->vidmem_start, share->vidmem_size);
#endif
// pci_release_regions(pdev);
@@ -1254,7 +1254,7 @@ static int __init lynxfb_setup(char * options)
char * opt,*tmp;
- if(!options || !*options){
+ if (!options || !*options) {
pr_warn("no options.\n");
return 0;
}
@@ -1263,7 +1263,7 @@ static int __init lynxfb_setup(char * options)
len = strlen(options) + 1;
g_settings = kzalloc(len, GFP_KERNEL);
- if(!g_settings)
+ if (!g_settings)
return -ENOMEM;
tmp = g_settings;
@@ -1276,20 +1276,20 @@ static int __init lynxfb_setup(char * options)
strsep() updates @options to pointer after the first found token
it also returns the pointer ahead the token.
*/
- while((opt = strsep(&options, ":"))!=NULL) {
+ while ((opt = strsep(&options, ":"))!=NULL) {
/* options that mean for any lynx chips are configured here */
- if(!strncmp(opt, "noaccel", strlen("noaccel")))
+ if (!strncmp(opt, "noaccel", strlen("noaccel")))
g_noaccel = 1;
#ifdef CONFIG_MTRR
- else if(!strncmp(opt, "nomtrr", strlen("nomtrr")))
+ else if (!strncmp(opt, "nomtrr", strlen("nomtrr")))
g_nomtrr = 1;
#endif
- else if(!strncmp(opt, "dual", strlen("dual")))
+ else if (!strncmp(opt, "dual", strlen("dual")))
g_dualview = 1;
else {
strcat(tmp, opt);
tmp += strlen(opt);
- if(options != NULL)
+ if (options != NULL)
*tmp++ = ':';
else
*tmp++ = 0;
@@ -1328,7 +1328,7 @@ static int __init lynxfb_init(void)
#ifdef MODULE
option = g_option;
#else
- if(fb_get_options("sm750fb", &option))
+ if (fb_get_options("sm750fb", &option))
return -ENODEV;
#endif
--
2.3.3
^ permalink raw reply related
* [PATCH 05/13] staging: sm750: fix whitespaces around pointers
From: Michel von Czettritz @ 2015-03-22 23:12 UTC (permalink / raw)
To: linux-fbdev
This patch fixes checkpatch.pl errors:
- ERROR: "foo * bar" should be "foo *bar"
- ERROR: "foo* bar" should be "foo *bar"
Signed-off-by: Michel von Czettritz <michel.von.czettritz@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 162 ++++++++++++++++++++--------------------
1 file changed, 81 insertions(+), 81 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 8469746..ad0c663 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -50,24 +50,24 @@ 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;
+static const char *g_fbmode[] = {NULL, NULL};
+static const char *g_def_fbmode = "800x600-16@60";
+static char *g_settings = NULL;
static int g_dualview;
-static char * g_option = NULL;
+static char *g_option = NULL;
/* if not use spin_lock,system will die if user load driver
* and immediatly unload driver frequently (dual)*/
-static inline void myspin_lock(spinlock_t * sl) {
- struct lynx_share * share;
+static inline void myspin_lock(spinlock_t *sl) {
+ struct lynx_share *share;
share = container_of(sl, struct lynx_share, slock);
if (share->dual) {
spin_lock(sl);
}
}
-static inline void myspin_unlock(spinlock_t * sl) {
- struct lynx_share * share;
+static inline void myspin_unlock(spinlock_t *sl) {
+ struct lynx_share *share;
share = container_of(sl, struct lynx_share, slock);
if (share->dual) {
spin_unlock(sl);
@@ -130,11 +130,11 @@ static const struct fb_videomode lynx750_ext[] = {
/* no hardware cursor supported under version 2.6.10, kernel bug */
-static int lynxfb_ops_cursor(struct fb_info* info, struct fb_cursor* fbcursor)
+static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor)
{
- struct lynxfb_par * par;
- struct lynxfb_crtc * crtc;
- struct lynx_cursor * cursor;
+ struct lynxfb_par *par;
+ struct lynxfb_crtc *crtc;
+ struct lynx_cursor *cursor;
par = info->par;
crtc = &par->crtc;
@@ -185,10 +185,10 @@ static int lynxfb_ops_cursor(struct fb_info* info, struct fb_cursor* fbcursor)
return 0;
}
-static void lynxfb_ops_fillrect(struct fb_info* info, const struct fb_fillrect* region)
+static void lynxfb_ops_fillrect(struct fb_info *info, const struct fb_fillrect *region)
{
- struct lynxfb_par * par;
- struct lynx_share * share;
+ struct lynxfb_par *par;
+ struct lynx_share *share;
unsigned int base, pitch, Bpp, rop;
u32 color;
@@ -217,10 +217,10 @@ static void lynxfb_ops_fillrect(struct fb_info* info, const struct fb_fillrect*
myspin_unlock(&share->slock);
}
-static void lynxfb_ops_copyarea(struct fb_info * info, const struct fb_copyarea * region)
+static void lynxfb_ops_copyarea(struct fb_info *info, const struct fb_copyarea *region)
{
- struct lynxfb_par * par;
- struct lynx_share * share;
+ struct lynxfb_par *par;
+ struct lynx_share *share;
unsigned int base, pitch, Bpp;
par = info->par;
@@ -240,12 +240,12 @@ static void lynxfb_ops_copyarea(struct fb_info * info, const struct fb_copyarea
myspin_unlock(&share->slock);
}
-static void lynxfb_ops_imageblit(struct fb_info*info, const struct fb_image* image)
+static void lynxfb_ops_imageblit(struct fb_info *info, const struct fb_image *image)
{
unsigned int base, pitch, Bpp;
unsigned int fgcol, bgcol;
- struct lynxfb_par * par;
- struct lynx_share * share;
+ struct lynxfb_par *par;
+ struct lynx_share *share;
par = info->par;
share = par->share;
@@ -281,8 +281,8 @@ _do_work:
static int lynxfb_ops_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info)
{
- struct lynxfb_par * par;
- struct lynxfb_crtc * crtc;
+ struct lynxfb_par *par;
+ struct lynxfb_crtc *crtc;
int ret;
@@ -297,14 +297,14 @@ static int lynxfb_ops_pan_display(struct fb_var_screeninfo *var,
return ret;
}
-static int lynxfb_ops_set_par(struct fb_info * info)
+static int lynxfb_ops_set_par(struct fb_info *info)
{
- struct lynxfb_par * par;
- struct lynx_share * share;
- struct lynxfb_crtc * crtc;
- struct lynxfb_output * output;
- struct fb_var_screeninfo * var;
- struct fb_fix_screeninfo * fix;
+ struct lynxfb_par *par;
+ struct lynx_share *share;
+ struct lynxfb_crtc *crtc;
+ struct lynxfb_output *output;
+ struct fb_var_screeninfo *var;
+ struct fb_fix_screeninfo *fix;
int ret;
unsigned int line_length;
@@ -379,7 +379,7 @@ static int lynxfb_ops_set_par(struct fb_info * info)
return ret;
}
-static inline unsigned int chan_to_field(unsigned int chan, struct fb_bitfield * bf)
+static inline unsigned int chan_to_field(unsigned int chan, struct fb_bitfield *bf)
{
chan &= 0xffff;
chan >>= 16 - bf->length;
@@ -439,14 +439,14 @@ static int lynxfb_suspend(struct pci_dev *pdev, pm_message_t mesg)
return ret;
}
-static int lynxfb_resume(struct pci_dev* pdev)
+static int lynxfb_resume(struct pci_dev *pdev)
{
- struct fb_info * info;
- struct lynx_share * share;
+ struct fb_info *info;
+ struct lynx_share *share;
- struct lynxfb_par * par;
- struct lynxfb_crtc * crtc;
- struct lynx_cursor * cursor;
+ struct lynxfb_par *par;
+ struct lynxfb_crtc *crtc;
+ struct lynx_cursor *cursor;
int ret;
@@ -506,12 +506,12 @@ static int lynxfb_resume(struct pci_dev* pdev)
}
#endif
-static int lynxfb_ops_check_var(struct fb_var_screeninfo* var, struct fb_info* info)
+static int lynxfb_ops_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
{
- struct lynxfb_par * par;
- struct lynxfb_crtc * crtc;
- struct lynxfb_output * output;
- struct lynx_share * share;
+ struct lynxfb_par *par;
+ struct lynxfb_crtc *crtc;
+ struct lynxfb_output *output;
+ struct lynx_share *share;
int ret;
resource_size_t request;
@@ -601,11 +601,11 @@ exit:
static int lynxfb_ops_setcolreg(unsigned regno, unsigned red,
unsigned green, unsigned blue,
- unsigned transp, struct fb_info * info)
+ unsigned transp, struct fb_info *info)
{
- struct lynxfb_par * par;
- struct lynxfb_crtc * crtc;
- struct fb_var_screeninfo * var;
+ struct lynxfb_par *par;
+ struct lynxfb_crtc *crtc;
+ struct fb_var_screeninfo *var;
int ret;
par = info->par;
@@ -650,10 +650,10 @@ exit:
return ret;
}
-static int lynxfb_ops_blank(int blank, struct fb_info* info)
+static int lynxfb_ops_blank(int blank, struct fb_info *info)
{
- struct lynxfb_par * par;
- struct lynxfb_output * output;
+ struct lynxfb_par *par;
+ struct lynxfb_output *output;
pr_debug("blank = %d.\n", blank);
par = info->par;
@@ -661,13 +661,13 @@ static int lynxfb_ops_blank(int blank, struct fb_info* info)
return output->proc_setBLANK(output, blank);
}
-static int sm750fb_set_drv(struct lynxfb_par * par)
+static int sm750fb_set_drv(struct lynxfb_par *par)
{
int ret;
- struct lynx_share * share;
- struct sm750_share * spec_share;
- struct lynxfb_output * output;
- struct lynxfb_crtc * crtc;
+ struct lynx_share *share;
+ struct sm750_share *spec_share;
+ struct lynxfb_output *output;
+ struct lynxfb_crtc *crtc;
ret = 0;
@@ -761,28 +761,28 @@ static struct fb_ops lynxfb_ops={
};
-static int lynxfb_set_fbinfo(struct fb_info* info, int index)
+static int lynxfb_set_fbinfo(struct fb_info *info, int index)
{
int i;
- struct lynxfb_par * par;
- struct lynx_share * share;
- struct lynxfb_crtc * crtc;
- struct lynxfb_output * output;
- struct fb_var_screeninfo * var;
- struct fb_fix_screeninfo * fix;
-
- const struct fb_videomode * pdb[] = {
+ struct lynxfb_par *par;
+ struct lynx_share *share;
+ struct lynxfb_crtc *crtc;
+ struct lynxfb_output *output;
+ struct fb_var_screeninfo *var;
+ struct fb_fix_screeninfo *fix;
+
+ const struct fb_videomode *pdb[] = {
lynx750_ext, NULL, vesa_modes,
};
int cdb[] = {ARRAY_SIZE(lynx750_ext), 0, VESA_MODEDB_SIZE};
- static const char * mdb_desc[] ={
+ static const char *mdb_desc[] ={
"driver prepared modes",
"kernel prepared default modedb",
"kernel HELPERS prepared vesa_modes",
};
- static const char * fixId[2] = {
+ static const char *fixId[2] = {
"sm750_fb1", "sm750_fb2",
};
@@ -959,12 +959,12 @@ exit:
}
/* chip specific g_option configuration routine */
-static void sm750fb_setup(struct lynx_share * share, char * src)
+static void sm750fb_setup(struct lynx_share *share, char *src)
{
- struct sm750_share * spec_share;
- char * opt;
+ struct sm750_share *spec_share;
+ char *opt;
#ifdef CAP_EXPENSION
- char * exp_res;
+ char *exp_res;
#endif
int swap;
@@ -1054,11 +1054,11 @@ NO_PARAM:
}
}
-static int lynxfb_pci_probe(struct pci_dev * pdev,
- const struct pci_device_id * ent)
+static int lynxfb_pci_probe(struct pci_dev *pdev,
+ const struct pci_device_id *ent)
{
- struct fb_info * info[] = {NULL, NULL};
- struct lynx_share * share = NULL;
+ struct fb_info *info[] = {NULL, NULL};
+ struct lynx_share *share = NULL;
struct sm750_share *spec_share = NULL;
size_t spec_offset = 0;
@@ -1158,7 +1158,7 @@ ALLOC_FB:
else
goto err_info1_alloc;
} else {
- struct lynxfb_par * par;
+ struct lynxfb_par *par;
int errno;
pr_info("framebuffer #%d alloc okay\n", fbidx);
share->fbinfo[fbidx] = info[fbidx];
@@ -1210,12 +1210,12 @@ err_enable:
return -ENODEV;
}
-static void __exit lynxfb_pci_remove(struct pci_dev * pdev)
+static void __exit lynxfb_pci_remove(struct pci_dev *pdev)
{
- struct fb_info * info;
- struct lynx_share * share;
- void * spec_share;
- struct lynxfb_par * par;
+ struct fb_info *info;
+ struct lynx_share *share;
+ void *spec_share;
+ struct lynxfb_par *par;
int cnt;
cnt = 2;
@@ -1248,10 +1248,10 @@ static void __exit lynxfb_pci_remove(struct pci_dev * pdev)
pci_set_drvdata(pdev, NULL);
}
-static int __init lynxfb_setup(char * options)
+static int __init lynxfb_setup(char *options)
{
int len;
- char * opt,*tmp;
+ char *opt, *tmp;
if (!options || !*options) {
--
2.3.3
^ permalink raw reply related
* [PATCH 06/13] staging: sm750: newline before { in function decl.
From: Michel von Czettritz @ 2015-03-22 23:13 UTC (permalink / raw)
To: linux-fbdev
This patch fixes checkpatch.pl error:
"ERROR: open brace '{' following function declarations go on the next line"
Signed-off-by: Michel von Czettritz <michel.von.czettritz@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index ad0c663..a0a8db7 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -58,7 +58,8 @@ static char *g_option = NULL;
/* if not use spin_lock,system will die if user load driver
* and immediatly unload driver frequently (dual)*/
-static inline void myspin_lock(spinlock_t *sl) {
+static inline void myspin_lock(spinlock_t *sl)
+{
struct lynx_share *share;
share = container_of(sl, struct lynx_share, slock);
if (share->dual) {
@@ -66,7 +67,8 @@ static inline void myspin_lock(spinlock_t *sl) {
}
}
-static inline void myspin_unlock(spinlock_t *sl) {
+static inline void myspin_unlock(spinlock_t *sl)
+{
struct lynx_share *share;
share = container_of(sl, struct lynx_share, slock);
if (share->dual) {
--
2.3.3
^ permalink raw reply related
* [PATCH 07/13] staging: sm750: no braces for single stmt if blocks
From: Michel von Czettritz @ 2015-03-22 23:13 UTC (permalink / raw)
To: linux-fbdev
This patches fixes checkpatch.pl warning:
"WARNING: braces {} are not necessary for single statement blocks"
Signed-off-by: Michel von Czettritz <michel.von.czettritz@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index a0a8db7..54857ba 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -62,18 +62,16 @@ static inline void myspin_lock(spinlock_t *sl)
{
struct lynx_share *share;
share = container_of(sl, struct lynx_share, slock);
- if (share->dual) {
+ if (share->dual)
spin_lock(sl);
- }
}
static inline void myspin_unlock(spinlock_t *sl)
{
struct lynx_share *share;
share = container_of(sl, struct lynx_share, slock);
- if (share->dual) {
+ if (share->dual)
spin_unlock(sl);
- }
}
static const struct fb_videomode lynx750_ext[] = {
/* 1024x600-60 VESA [1.71:1] */
@@ -149,9 +147,8 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor)
}
cursor->disable(cursor);
- if (fbcursor->set & FB_CUR_SETSIZE) {
+ if (fbcursor->set & FB_CUR_SETSIZE)
cursor->setSize(cursor, fbcursor->image.width, fbcursor->image.height);
- }
if (fbcursor->set & FB_CUR_SETPOS) {
cursor->setPos(cursor, fbcursor->image.dx - info->var.xoffset,
@@ -180,9 +177,8 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor)
fbcursor->mask);
}
- if (fbcursor->enable) {
+ if (fbcursor->enable)
cursor->enable(cursor);
- }
return 0;
}
@@ -194,9 +190,8 @@ static void lynxfb_ops_fillrect(struct fb_info *info, const struct fb_fillrect *
unsigned int base, pitch, Bpp, rop;
u32 color;
- if (info->state != FBINFO_STATE_RUNNING) {
+ if (info->state != FBINFO_STATE_RUNNING)
return;
- }
par = info->par;
share = par->share;
--
2.3.3
^ permalink raw reply related
* [PATCH 08/13] staging: sm750: comment formating
From: Michel von Czettritz @ 2015-03-22 23:13 UTC (permalink / raw)
To: linux-fbdev
This patch fixes checkpatch.pl warnings / errors:
- "WARNING: please, no space before tabs"
- "ERROR: do not use C99 // comments"
Signed-off-by: Michel von Czettritz <michel.von.czettritz@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 54857ba..ab58987 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -74,19 +74,19 @@ static inline void myspin_unlock(spinlock_t *sl)
spin_unlock(sl);
}
static const struct fb_videomode lynx750_ext[] = {
- /* 1024x600-60 VESA [1.71:1] */
+ /* 1024x600-60 VESA [1.71:1]*/
{NULL, 60, 1024, 600, 20423, 144, 40, 18, 1, 104, 3,
FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
- /* 1024x600-70 VESA */
+ /* 1024x600-70 VESA */
{NULL, 70, 1024, 600, 17211, 152, 48, 21, 1, 104, 3,
FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
- /* 1024x600-75 VESA */
+ /* 1024x600-75 VESA */
{NULL, 75, 1024, 600, 15822, 160, 56, 23, 1, 104, 3,
FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
- /* 1024x600-85 VESA */
+ /* 1024x600-85 VESA */
{NULL, 85, 1024, 600, 13730, 168, 56, 26, 1, 112, 3,
FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
@@ -98,7 +98,7 @@ static const struct fb_videomode lynx750_ext[] = {
{NULL, 60, 1280, 720, 13426, 162, 86, 22, 1, 136, 3,
FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
- /* 1280x768@60 */
+ /* 1280x768@60 */
{NULL, 60, 1280, 768, 12579, 192, 64, 20, 3, 128, 7,
FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
@@ -113,7 +113,7 @@ static const struct fb_videomode lynx750_ext[] = {
{NULL, 60, 1368, 768, 11647, 216, 72, 23, 1, 144, 3,
FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
- /* 1440 x 900 [16:10] */
+ /* 1440 x 900 [16:10] */
{NULL, 60, 1440, 900, 9392, 232, 80, 28, 1, 152, 3,
FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
@@ -610,7 +610,7 @@ static int lynxfb_ops_setcolreg(unsigned regno, unsigned red,
var = &info->var;
ret = 0;
- //pr_debug("regno=%d,red=%d,green=%d,blue=%d\n",regno,red,green,blue);
+ /*pr_debug("regno=%d,red=%d,green=%d,blue=%d\n",regno,red,green,blue);*/
if (regno > 256) {
pr_err("regno = %d\n", regno);
return -EINVAL;
@@ -683,7 +683,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
crtc->proc_panDisplay = hw_sm750_pan_display;
crtc->clear = hw_sm750_crtc_clear;
crtc->line_pad = 16;
- //crtc->xpanstep = crtc->ypanstep = crtc->ywrapstep = 0;
+ /*crtc->xpanstep = crtc->ypanstep = crtc->ywrapstep = 0;*/
crtc->xpanstep = 8;
crtc->ypanstep = 1;
crtc->ywrapstep = 0;
@@ -858,7 +858,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
break;
} else if (ret = 3) {
pr_warn("wanna use default mode\n");
- // break;
+ /*break;*/
} else if (ret = 4) {
pr_warn("fall back to any valid mode\n");
} else {
@@ -951,11 +951,11 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
exit:
lynxfb_ops_check_var(var, info);
- // lynxfb_ops_set_par(info);
+ /* lynxfb_ops_set_par(info);*/
return ret;
}
-/* chip specific g_option configuration routine */
+/* chip specific g_option configuration routine */
static void sm750fb_setup(struct lynx_share *share, char *src)
{
struct sm750_share *spec_share;
@@ -1235,7 +1235,7 @@ static void __exit lynxfb_pci_remove(struct pci_dev *pdev)
if (share->mtrr.vram_added)
mtrr_del(share->mtrr.vram, share->vidmem_start, share->vidmem_size);
#endif
- // pci_release_regions(pdev);
+ /*pci_release_regions(pdev);*/
iounmap(share->pvReg);
iounmap(share->pvMem);
@@ -1265,7 +1265,7 @@ static int __init lynxfb_setup(char *options)
tmp = g_settings;
- /* Notes:
+ /* Notes:
char * strsep(char **s,const char * ct);
@s: the string to be searched
@ct :the characters to search for
--
2.3.3
^ permalink raw reply related
* [PATCH 09/13] staging: sm750: 80 characters per line
From: Michel von Czettritz @ 2015-03-22 23:14 UTC (permalink / raw)
To: linux-fbdev
This patch inserts line breaks to make lines fit into 80 characters and increase readability.
Signed-off-by: Michel von Czettritz <michel.von.czettritz@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 96 ++++++++++++++++++++++++++++-------------
1 file changed, 65 insertions(+), 31 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index ab58987..90dc801 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -76,54 +76,66 @@ static inline void myspin_unlock(spinlock_t *sl)
static const struct fb_videomode lynx750_ext[] = {
/* 1024x600-60 VESA [1.71:1]*/
{NULL, 60, 1024, 600, 20423, 144, 40, 18, 1, 104, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ FB_VMODE_NONINTERLACED},
/* 1024x600-70 VESA */
{NULL, 70, 1024, 600, 17211, 152, 48, 21, 1, 104, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ FB_VMODE_NONINTERLACED},
/* 1024x600-75 VESA */
{NULL, 75, 1024, 600, 15822, 160, 56, 23, 1, 104, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ FB_VMODE_NONINTERLACED},
/* 1024x600-85 VESA */
{NULL, 85, 1024, 600, 13730, 168, 56, 26, 1, 112, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ FB_VMODE_NONINTERLACED},
/* 720x480 */
{NULL, 60, 720, 480, 37427, 88, 16, 13, 1, 72, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ FB_VMODE_NONINTERLACED},
/* 1280x720 [1.78:1] */
{NULL, 60, 1280, 720, 13426, 162, 86, 22, 1, 136, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ FB_VMODE_NONINTERLACED},
/* 1280x768@60 */
{NULL, 60, 1280, 768, 12579, 192, 64, 20, 3, 128, 7,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
+ 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, FB_VMODE_NONINTERLACED},
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ FB_VMODE_NONINTERLACED},
/* 1368 x 768 [1.78:1] */
{NULL, 60, 1368, 768, 11647, 216, 72, 23, 1, 144, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ FB_VMODE_NONINTERLACED},
/* 1440 x 900 [16:10] */
{NULL, 60, 1440, 900, 9392, 232, 80, 28, 1, 152, 3,
- FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
+ FB_SYNC_VERT_HIGH_ACT,
+ FB_VMODE_NONINTERLACED},
/* 1440x960 [15:10] */
{NULL, 60, 1440, 960, 8733, 240, 88, 30, 1, 152, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ FB_VMODE_NONINTERLACED},
/* 1920x1080 [16:9] */
{NULL, 60, 1920, 1080, 6734, 148, 88, 41, 1, 44, 3,
- FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
+ FB_SYNC_VERT_HIGH_ACT,
+ FB_VMODE_NONINTERLACED},
};
@@ -148,12 +160,14 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor)
cursor->disable(cursor);
if (fbcursor->set & FB_CUR_SETSIZE)
- cursor->setSize(cursor, fbcursor->image.width, fbcursor->image.height);
+ cursor->setSize(cursor,
+ fbcursor->image.width,
+ fbcursor->image.height);
- if (fbcursor->set & FB_CUR_SETPOS) {
- cursor->setPos(cursor, fbcursor->image.dx - info->var.xoffset,
+ if (fbcursor->set & FB_CUR_SETPOS)
+ cursor->setPos(cursor,
+ fbcursor->image.dx - info->var.xoffset,
fbcursor->image.dy - info->var.yoffset);
- }
if (fbcursor->set & FB_CUR_SETCMAP) {
/* get the 16bit color of kernel means */
@@ -183,7 +197,8 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor)
return 0;
}
-static void lynxfb_ops_fillrect(struct fb_info *info, const struct fb_fillrect *region)
+static void lynxfb_ops_fillrect(struct fb_info *info,
+ const struct fb_fillrect *region)
{
struct lynxfb_par *par;
struct lynx_share *share;
@@ -214,7 +229,8 @@ static void lynxfb_ops_fillrect(struct fb_info *info, const struct fb_fillrect *
myspin_unlock(&share->slock);
}
-static void lynxfb_ops_copyarea(struct fb_info *info, const struct fb_copyarea *region)
+static void lynxfb_ops_copyarea(struct fb_info *info,
+ const struct fb_copyarea *region)
{
struct lynxfb_par *par;
struct lynx_share *share;
@@ -237,7 +253,8 @@ static void lynxfb_ops_copyarea(struct fb_info *info, const struct fb_copyarea *
myspin_unlock(&share->slock);
}
-static void lynxfb_ops_imageblit(struct fb_info *info, const struct fb_image *image)
+static void lynxfb_ops_imageblit(struct fb_info *info,
+ const struct fb_image *image)
{
unsigned int base, pitch, Bpp;
unsigned int fgcol, bgcol;
@@ -376,7 +393,8 @@ static int lynxfb_ops_set_par(struct fb_info *info)
return ret;
}
-static inline unsigned int chan_to_field(unsigned int chan, struct fb_bitfield *bf)
+static inline unsigned int chan_to_field(unsigned int chan,
+ struct fb_bitfield *bf)
{
chan &= 0xffff;
chan >>= 16 - bf->length;
@@ -503,7 +521,8 @@ static int lynxfb_resume(struct pci_dev *pdev)
}
#endif
-static int lynxfb_ops_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
+static int lynxfb_ops_check_var(struct fb_var_screeninfo *var,
+ struct fb_info *info)
{
struct lynxfb_par *par;
struct lynxfb_crtc *crtc;
@@ -577,7 +596,7 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var, struct fb_info *i
var->height = var->width = -1;
var->accel_flags = 0;/*FB_ACCELF_TEXT;*/
- /* check if current fb's video memory big enought to hold the onscreen */
+ /* check if current fb's video memory big enought to hold the onscreen*/
request = var->xres_virtual * (var->bits_per_pixel >> 3);
/* defaulty crtc->channel go with par->index */
@@ -619,7 +638,8 @@ static int lynxfb_ops_setcolreg(unsigned regno, unsigned red,
if (info->var.grayscale)
red = green = blue = (red * 77 + green * 151 + blue * 28) >> 8;
- if (var->bits_per_pixel = 8 && info->fix.visual = FB_VISUAL_PSEUDOCOLOR) {
+ if (var->bits_per_pixel = 8 &&
+ info->fix.visual = FB_VISUAL_PSEUDOCOLOR) {
red >>= 8;
green >>= 8;
blue >>= 8;
@@ -862,7 +882,9 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
} else if (ret = 4) {
pr_warn("fall back to any valid mode\n");
} else {
- pr_warn("ret = %d,fb_find_mode failed,with %s\n", ret, mdb_desc[i]);
+ pr_warn("ret = %d,fb_find_mode failed,with %s\n",
+ ret,
+ mdb_desc[i]);
}
}
@@ -876,8 +898,14 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
xoffset=%d\n\
yoffset=%d\n\
bits_per_pixel=%d\n \
- ...\n", var->xres, var->yres, var->xres_virtual, var->yres_virtual,
- var->xoffset, var->yoffset, var->bits_per_pixel);
+ ...\n",
+ var->xres,
+ var->yres,
+ var->xres_virtual,
+ var->yres_virtual,
+ var->xoffset,
+ var->yoffset,
+ var->bits_per_pixel);
/* set par */
par->info = info;
@@ -1024,7 +1052,9 @@ static void sm750fb_setup(struct lynx_share *share, char *src)
}
}
#ifdef CAP_EXPANSION
- if (getExpRes(exp_res, &spec_share->state.xLCD, &spec_share->state.yLCD)) {
+ if (getExpRes(exp_res,
+ &spec_share->state.xLCD,
+ &spec_share->state.yLCD)) {
/* seems exp_res is not valid*/
spec_share->state.xLCD = spec_share->state.yLCD = 0;
}
@@ -1098,8 +1128,8 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
if (!share->accel_off) {
/* hook deInit and 2d routines, notes that below hw_xxx
* routine can work on most of lynx chips
- * if some chip need specific function,please hook it in smXXX_set_drv
- * routine */
+ * if some chip need specific function,
+ * please hook it in smXXX_set_drv routine */
share->accel.de_init = hw_de_init;
share->accel.de_fillrect = hw_fillrect;
share->accel.de_copyarea = hw_copyarea;
@@ -1175,7 +1205,9 @@ ALLOC_FB:
pr_info("Ready to register framebuffer #%d.\n", fbidx);
errno = register_framebuffer(info[fbidx]);
if (errno < 0) {
- pr_err("Failed to register fb_info #%d. err %d\n", fbidx, errno);
+ pr_err("Failed to register fb_info #%d. err %d\n",
+ fbidx,
+ errno);
if (fbidx = 0)
goto err_register0;
else
@@ -1233,7 +1265,9 @@ static void __exit lynxfb_pci_remove(struct pci_dev *pdev)
}
#ifdef CONFIG_MTRR
if (share->mtrr.vram_added)
- mtrr_del(share->mtrr.vram, share->vidmem_start, share->vidmem_size);
+ mtrr_del(share->mtrr.vram,
+ share->vidmem_start,
+ share->vidmem_size);
#endif
/*pci_release_regions(pdev);*/
--
2.3.3
^ permalink raw reply related
* [PATCH 10/13] staging: sm750: blank line after declaration
From: Michel von Czettritz @ 2015-03-22 23:14 UTC (permalink / raw)
To: linux-fbdev
This patch fixes "WARNING: Missing a blank line after declaration"
checkpatch.pl warnings.
Signed-off-by: Michel von Czettritz <michel.von.czettritz@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 90dc801..870bf6f 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -61,6 +61,7 @@ static char *g_option = NULL;
static inline void myspin_lock(spinlock_t *sl)
{
struct lynx_share *share;
+
share = container_of(sl, struct lynx_share, slock);
if (share->dual)
spin_lock(sl);
@@ -69,6 +70,7 @@ static inline void myspin_lock(spinlock_t *sl)
static inline void myspin_unlock(spinlock_t *sl)
{
struct lynx_share *share;
+
share = container_of(sl, struct lynx_share, slock);
if (share->dual)
spin_unlock(sl);
@@ -172,6 +174,7 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor)
if (fbcursor->set & FB_CUR_SETCMAP) {
/* get the 16bit color of kernel means */
u16 fg, bg;
+
fg = ((info->cmap.red[fbcursor->image.fg_color] & 0xf800))|
((info->cmap.green[fbcursor->image.fg_color] & 0xfc00) >> 5)|
((info->cmap.blue[fbcursor->image.fg_color] & 0xf800) >> 11);
@@ -650,6 +653,7 @@ static int lynxfb_ops_setcolreg(unsigned regno, unsigned red,
if (info->fix.visual = FB_VISUAL_TRUECOLOR && regno < 256) {
u32 val;
+
if (var->bits_per_pixel = 16 ||
var->bits_per_pixel = 32 ||
var->bits_per_pixel = 24) {
@@ -1187,6 +1191,7 @@ ALLOC_FB:
} else {
struct lynxfb_par *par;
int errno;
+
pr_info("framebuffer #%d alloc okay\n", fbidx);
share->fbinfo[fbidx] = info[fbidx];
par = info[fbidx]->par;
--
2.3.3
^ permalink raw reply related
* [PATCH 11/13] staging: sm750: fix whitespace
From: Michel von Czettritz @ 2015-03-22 23:14 UTC (permalink / raw)
To: linux-fbdev
This patch fixes whitespace checkpatch.pl warnings and errors.
Mainly whitespaces around operators.
- ERROR: spaces required around that ':' (ctx:VxW)
- ERROR: space required after that ';' (ctx:VxV)
- ERROR: spaces required around that '<' (ctx:VxV)
- ERROR: spaces required around that '!=' (ctx:VxV)
And some small warnings around whitespace:
- ERROR: trailing whitespace
- WARNING: space prohibited before semicolon
- WARNING: unnecessary whitespace before a quoted newline
Signed-off-by: Michel von Czettritz <michel.von.czettritz@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 870bf6f..917e4b4 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -61,7 +61,7 @@ static char *g_option = NULL;
static inline void myspin_lock(spinlock_t *sl)
{
struct lynx_share *share;
-
+
share = container_of(sl, struct lynx_share, slock);
if (share->dual)
spin_lock(sl);
@@ -70,7 +70,7 @@ static inline void myspin_lock(spinlock_t *sl)
static inline void myspin_unlock(spinlock_t *sl)
{
struct lynx_share *share;
-
+
share = container_of(sl, struct lynx_share, slock);
if (share->dual)
spin_unlock(sl);
@@ -174,7 +174,7 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor)
if (fbcursor->set & FB_CUR_SETCMAP) {
/* get the 16bit color of kernel means */
u16 fg, bg;
-
+
fg = ((info->cmap.red[fbcursor->image.fg_color] & 0xf800))|
((info->cmap.green[fbcursor->image.fg_color] & 0xfc00) >> 5)|
((info->cmap.blue[fbcursor->image.fg_color] & 0xf800) >> 11);
@@ -375,7 +375,7 @@ static int lynxfb_ops_set_par(struct fb_info *info)
var->red.length = 8;
var->green.offset = 8;
var->green.length = 8;
- var->blue.offset = 0 ;
+ var->blue.offset = 0;
var->blue.length = 8;
fix->visual = FB_VISUAL_TRUECOLOR;
break;
@@ -588,7 +588,7 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var,
var->red.length = 8;
var->green.offset = 8;
var->green.length = 8;
- var->blue.offset = 0 ;
+ var->blue.offset = 0;
var->blue.length = 8;
info->fix.visual = FB_VISUAL_TRUECOLOR;
break;
@@ -653,7 +653,7 @@ static int lynxfb_ops_setcolreg(unsigned regno, unsigned red,
if (info->fix.visual = FB_VISUAL_TRUECOLOR && regno < 256) {
u32 val;
-
+
if (var->bits_per_pixel = 16 ||
var->bits_per_pixel = 32 ||
var->bits_per_pixel = 24) {
@@ -718,7 +718,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
output->proc_setBLANK = (share->revid = SM750LE_REVISION_ID)?hw_sm750le_setBLANK:hw_sm750_setBLANK;
output->clear = hw_sm750_output_clear;
/* chip specific phase */
- share->accel.de_wait = (share->revid = SM750LE_REVISION_ID)?hw_sm750le_deWait: hw_sm750_deWait;
+ share->accel.de_wait = (share->revid = SM750LE_REVISION_ID)?hw_sm750le_deWait : hw_sm750_deWait;
switch (spec_share->state.dataflow) {
case sm750_simul_pri:
output->paths = sm750_pnc;
@@ -768,7 +768,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
return ret;
}
-static struct fb_ops lynxfb_ops={
+static struct fb_ops lynxfb_ops = {
.owner = THIS_MODULE,
.fb_check_var = lynxfb_ops_check_var,
.fb_set_par = lynxfb_ops_set_par,
@@ -796,7 +796,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
lynx750_ext, NULL, vesa_modes,
};
int cdb[] = {ARRAY_SIZE(lynx750_ext), 0, VESA_MODEDB_SIZE};
- static const char *mdb_desc[] ={
+ static const char *mdb_desc[] = {
"driver prepared modes",
"kernel prepared default modedb",
"kernel HELPERS prepared vesa_modes",
@@ -865,7 +865,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
}
- for (i=0;i<3;i++) {
+ for (i = 0; i < 3; i++) {
ret = fb_find_mode(var, info, g_fbmode[index],
pdb[i], cdb[i], NULL, 8);
@@ -976,7 +976,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
goto exit;
}
- pr_debug("#2 show info->cmap : \nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n",
+ pr_debug("#2 show info->cmap :\nstart=%d,len=%d,red=%p,green=%p,blue=%p,transp=%p\n",
info->cmap.start, info->cmap.len,
info->cmap.red, info->cmap.green, info->cmap.blue,
info->cmap.transp);
@@ -1191,7 +1191,7 @@ ALLOC_FB:
} else {
struct lynxfb_par *par;
int errno;
-
+
pr_info("framebuffer #%d alloc okay\n", fbidx);
share->fbinfo[fbidx] = info[fbidx];
par = info[fbidx]->par;
@@ -1312,7 +1312,7 @@ static int __init lynxfb_setup(char *options)
strsep() updates @options to pointer after the first found token
it also returns the pointer ahead the token.
*/
- while ((opt = strsep(&options, ":"))!=NULL) {
+ while ((opt = strsep(&options, ":")) != NULL) {
/* options that mean for any lynx chips are configured here */
if (!strncmp(opt, "noaccel", strlen("noaccel")))
g_noaccel = 1;
@@ -1358,7 +1358,7 @@ static struct pci_driver lynxfb_driver = {
static int __init lynxfb_init(void)
{
- char *option ;
+ char *option;
int ret;
#ifdef MODULE
--
2.3.3
^ permalink raw reply related
* [PATCH 12/13] staging: sm750: fix whitspace for cast to pointer
From: Michel von Czettritz @ 2015-03-22 23:14 UTC (permalink / raw)
To: linux-fbdev
This patch fixes the checkpatch.pl warning:
'ERROR: "(foo*)" should be "(foo *)"'
Signed-off-by: Michel von Czettritz <michel.von.czettritz@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 917e4b4..c250882 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -220,7 +220,7 @@ static void lynxfb_ops_fillrect(struct fb_info *info,
pitch = info->fix.line_length;
Bpp = info->var.bits_per_pixel >> 3;
- color = (Bpp = 1)?region->color:((u32*)info->pseudo_palette)[region->color];
+ color = (Bpp = 1)?region->color:((u32 *)info->pseudo_palette)[region->color];
rop = (region->rop != ROP_COPY) ? HW_ROP2_XOR:HW_ROP2_COPY;
myspin_lock(&share->slock);
@@ -275,8 +275,8 @@ static void lynxfb_ops_imageblit(struct fb_info *info,
if (image->depth = 1) {
if (info->fix.visual = FB_VISUAL_TRUECOLOR ||
info->fix.visual = FB_VISUAL_DIRECTCOLOR) {
- fgcol = ((u32*)info->pseudo_palette)[image->fg_color];
- bgcol = ((u32*)info->pseudo_palette)[image->bg_color];
+ fgcol = ((u32 *)info->pseudo_palette)[image->fg_color];
+ bgcol = ((u32 *)info->pseudo_palette)[image->bg_color];
} else {
fgcol = image->fg_color;
bgcol = image->bg_color;
--
2.3.3
^ permalink raw reply related
* [PATCH 13/13] staging: sm750: move assignment out of if cond
From: Michel von Czettritz @ 2015-03-22 23:15 UTC (permalink / raw)
To: linux-fbdev
This patch moves the assignments from the if conditions to the line before the condition.
The 3 occurrence are return values and the checks for errors.
Signed-off-by: Michel von Czettritz <michel.von.czettritz@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index c250882..a4a7fed 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -474,7 +474,8 @@ static int lynxfb_resume(struct pci_dev *pdev)
console_lock();
- if ((ret = pci_set_power_state(pdev, PCI_D0)) != 0) {
+ ret = pci_set_power_state(pdev, PCI_D0);
+ if (ret != 0) {
pr_err("error:%d occured in pci_set_power_state\n", ret);
return ret;
}
@@ -482,7 +483,8 @@ static int lynxfb_resume(struct pci_dev *pdev)
if (pdev->dev.power.power_state.event != PM_EVENT_FREEZE) {
pci_restore_state(pdev);
- if ((ret = pci_enable_device(pdev)) != 0) {
+ ret = pci_enable_device(pdev);
+ if (ret != 0) {
pr_err("error:%d occured in pci_enable_device\n", ret);
return ret;
}
@@ -971,7 +973,8 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
info->cmap.red, info->cmap.green, info->cmap.blue,
info->cmap.transp);
- if ((ret = fb_alloc_cmap(&info->cmap, 256, 0)) < 0) {
+ ret = fb_alloc_cmap(&info->cmap, 256, 0);
+ if (ret < 0) {
pr_err("Could not allcate memory for cmap.\n");
goto exit;
}
--
2.3.3
^ permalink raw reply related
* Re: [PATCH RESEND 2 1/5] staging: sm750fb: Use memset_io instead of memset
From: Dan Carpenter @ 2015-03-23 10:53 UTC (permalink / raw)
To: Lorenzo Stoakes
Cc: sudipm.mukherjee, teddy.wang, gregkh, devel, linux-fbdev,
linux-kernel
In-Reply-To: <1426864935-29350-1-git-send-email-lstoakes@gmail.com>
Sorry I wasn't clear on this before. Please, stop putting RESEND in the
subject. That's only for if you think we are screwing up or ignoring
you. Just put v2, and put what changed under the --- cut off.
---
v2: changed the commit message
https://www.google.com/#q=how+to+send+a+v2+patch
Otherwise this set looks ok. Thanks!
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH RESEND 2 1/5] staging: sm750fb: Use memset_io instead of memset
From: Lorenzo Stoakes @ 2015-03-23 11:14 UTC (permalink / raw)
To: Dan Carpenter
Cc: Sudip Mukherjee, Teddy Wang, Greg KH, devel, linux-fbdev,
linux-kernel
In-Reply-To: <20150323105323.GA10964@mwanda>
On 23 March 2015 at 10:53, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> Sorry I wasn't clear on this before. Please, stop putting RESEND in the
> subject. That's only for if you think we are screwing up or ignoring
> you. Just put v2, and put what changed under the --- cut off.
> ---
> v2: changed the commit message
>
> https://www.google.com/#q=how+to+send+a+v2+patch
>
I have to say I'm quite massively confused on this :) and the linux
newbies link at the top of the results for that google search doesn't
seem to clear it up for me. May I be so cheeky as to ask you to help
me understand so I can do this better in future?:-
* Greg has asked me to send again because it wasn't clear which set
was applicable. This is why I appended RESEND 2 (the original RESEND
was the same deal but *also* containing fixups to apply to the latest
staging-testing) since I wasn't changing anything, just resending to
make clear which patch set is valid right now. In this case should I
simply append a version number to each patch in the series and resend?
* Which leads on to the next point of confusion - previously when I
changed *one* patch in a series then resent *all* patches in that
series with v2, I had complaints that 'this patch hasn't changed' on
the unchanged patches, leading me to think that you should only resend
patches that have actually changed (which fits the pattern of putting
a change message under the '---' - though of course you could say v2:
resend patchset or similar) - however this seems to be what causes the
confusion that leads to needing a resend in the first instance (maybe
a problem with options I'm passing to git send-email, perhaps I need
to use in-reply-to to make the v2's replies to the v1's.)
* If the former point is correct and I should only resend patches that
have actually changed, but I'm asked for a resend - what is the
correct course of action? And of course we end up with some patches at
v>1, some at v1, so should all patches then be updated to v(MAX(v)+1)?
> Otherwise this set looks ok. Thanks!
>
> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
>
Thanks for that, appreciated!
Best,
--
Lorenzo Stoakes
https:/ljs.io
^ permalink raw reply
* Re: [PATCH 01/13] staging: sm750: Reintend
From: Dan Carpenter @ 2015-03-23 11:17 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <20150322230807.GA16817@x230-arch.club.entropia.de>
On Mon, Mar 23, 2015 at 12:08:07AM +0100, Michel von Czettritz wrote:
> The reintend fixes the
Spelling. re-indent.
> typedef void (*PROC_SPEC_SETUP)(struct lynx_share*,char *);
> @@ -76,54 +76,54 @@ static inline void myspin_unlock(spinlock_t * sl){
> static const struct fb_videomode lynx750_ext[] = {
> /* 1024x600-60 VESA [1.71:1] */
> {NULL, 60, 1024, 600, 20423, 144, 40, 18, 1, 104, 3,
> - FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
> + FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
>
Do it like this:
{NULL, 60, 1024, 600, 20423, 144, 40, 18, 1, 104, 3,
FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED},
> @@ -141,8 +141,8 @@ static int lynxfb_ops_cursor(struct fb_info* info,struct fb_cursor* fbcursor)
> cursor = &crtc->cursor;
>
> if(fbcursor->image.width > cursor->maxW ||
> - fbcursor->image.height > cursor->maxH ||
> - fbcursor->image.depth > 1){
> + fbcursor->image.height > cursor->maxH ||
> + fbcursor->image.depth > 1){
This should be:
if (fbcursor->image.width > cursor->maxW ||
fbcursor->image.height > cursor->maxH ||
fbcursor->image.depth > 1)
return -ENXIO;
The new indenting is whacky.
> return -ENXIO;
> }
>
> @@ -153,19 +153,19 @@ static int lynxfb_ops_cursor(struct fb_info* info,struct fb_cursor* fbcursor)
>
> if(fbcursor->set & FB_CUR_SETPOS){
> cursor->setPos(cursor,fbcursor->image.dx - info->var.xoffset,
> - fbcursor->image.dy - info->var.yoffset);
> + fbcursor->image.dy - info->var.yoffset);
> }
This should be:
cursor->setPos(cursor, fbcursor->image.dx - info->var.xoffset,
fbcursor->image.dy - info->var.yoffset);
[tab][tab][tab][space][space][space][space][space][space][space]fbcursor->
Etc.
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH 0/13] staging: sm750: reformat sm750.c
From: Dan Carpenter @ 2015-03-23 11:20 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <20150322230718.GA16751@x230-arch.club.entropia.de>
These are going to conflict with Lorenzo's patches.
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH 08/13] staging: sm750: comment formating
From: Dan Carpenter @ 2015-03-23 11:22 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <20150322231340.GA17233@x230-arch.club.entropia.de>
On Mon, Mar 23, 2015 at 12:13:41AM +0100, Michel von Czettritz wrote:
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> index 54857ba..ab58987 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -74,19 +74,19 @@ static inline void myspin_unlock(spinlock_t *sl)
> spin_unlock(sl);
> }
> static const struct fb_videomode lynx750_ext[] = {
> - /* 1024x600-60 VESA [1.71:1] */
> + /* 1024x600-60 VESA [1.71:1]*/
Leave a space before the "*/"
> @@ -610,7 +610,7 @@ static int lynxfb_ops_setcolreg(unsigned regno, unsigned red,
> var = &info->var;
> ret = 0;
>
> - //pr_debug("regno=%d,red=%d,green=%d,blue=%d\n",regno,red,green,blue);
> + /*pr_debug("regno=%d,red=%d,green=%d,blue=%d\n",regno,red,green,blue);*/
Just delete these. Also, missing spaces next to /* and */.
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH 09/13] staging: sm750: 80 characters per line
From: Dan Carpenter @ 2015-03-23 11:23 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <20150322231401.GA17255@x230-arch.club.entropia.de>
Redo this one per the alignment rules I explained previously.
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH 10/13] staging: sm750: blank line after declaration
From: Dan Carpenter @ 2015-03-23 11:26 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <20150322231416.GA17270@x230-arch.club.entropia.de>
On Mon, Mar 23, 2015 at 12:14:17AM +0100, Michel von Czettritz wrote:
> This patch fixes "WARNING: Missing a blank line after declaration"
> checkpatch.pl warnings.
>
> Signed-off-by: Michel von Czettritz <michel.von.czettritz@gmail.com>
> ---
> drivers/staging/sm750fb/sm750.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> index 90dc801..870bf6f 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -61,6 +61,7 @@ static char *g_option = NULL;
> static inline void myspin_lock(spinlock_t *sl)
> {
> struct lynx_share *share;
> +
These introduces new checkpatch warnings. Use checkpatch.pl on your own
patches.
regards,
dan carpenter
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox