aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorRobert Reif <reif@earthlink.net>2008-10-10 15:12:41 -0400
committerDavid S. Miller <davem@davemloft.net>2008-10-10 15:12:41 -0400
commit291d5f30399c258344c71069552b82b694bb2b34 (patch)
tree157275d212d1d22151c13089f0065ec99f9fd0d7 /drivers/video
parent6cf4a9243a7fea75e7fd6f2e1ba6fb01c805e056 (diff)
cg6: disable cursor when leaving graphics mode
On sparc32 debian etch, the cursor is not disabled when leaving X windows. This patch disables the cursor when leaving graphics mode just like the ffb driver. Signed-off-by: Robert Reif <reif@earthlink.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/cg6.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/drivers/video/cg6.c b/drivers/video/cg6.c
index 9eaa63ab08fa..940ec04f0f1b 100644
--- a/drivers/video/cg6.c
+++ b/drivers/video/cg6.c
@@ -34,10 +34,11 @@ static int cg6_blank(int, struct fb_info *);
34 34
35static void cg6_imageblit(struct fb_info *, const struct fb_image *); 35static void cg6_imageblit(struct fb_info *, const struct fb_image *);
36static void cg6_fillrect(struct fb_info *, const struct fb_fillrect *); 36static void cg6_fillrect(struct fb_info *, const struct fb_fillrect *);
37static void cg6_copyarea(struct fb_info *info, const struct fb_copyarea *area);
37static int cg6_sync(struct fb_info *); 38static int cg6_sync(struct fb_info *);
38static int cg6_mmap(struct fb_info *, struct vm_area_struct *); 39static int cg6_mmap(struct fb_info *, struct vm_area_struct *);
39static int cg6_ioctl(struct fb_info *, unsigned int, unsigned long); 40static int cg6_ioctl(struct fb_info *, unsigned int, unsigned long);
40static void cg6_copyarea(struct fb_info *info, const struct fb_copyarea *area); 41static int cg6_pan_display(struct fb_var_screeninfo *, struct fb_info *);
41 42
42/* 43/*
43 * Frame buffer operations 44 * Frame buffer operations
@@ -47,6 +48,7 @@ static struct fb_ops cg6_ops = {
47 .owner = THIS_MODULE, 48 .owner = THIS_MODULE,
48 .fb_setcolreg = cg6_setcolreg, 49 .fb_setcolreg = cg6_setcolreg,
49 .fb_blank = cg6_blank, 50 .fb_blank = cg6_blank,
51 .fb_pan_display = cg6_pan_display,
50 .fb_fillrect = cg6_fillrect, 52 .fb_fillrect = cg6_fillrect,
51 .fb_copyarea = cg6_copyarea, 53 .fb_copyarea = cg6_copyarea,
52 .fb_imageblit = cg6_imageblit, 54 .fb_imageblit = cg6_imageblit,
@@ -161,6 +163,7 @@ static struct fb_ops cg6_ops = {
161#define CG6_THC_MISC_INT_ENAB (1 << 5) 163#define CG6_THC_MISC_INT_ENAB (1 << 5)
162#define CG6_THC_MISC_INT (1 << 4) 164#define CG6_THC_MISC_INT (1 << 4)
163#define CG6_THC_MISC_INIT 0x9f 165#define CG6_THC_MISC_INIT 0x9f
166#define CG6_THC_CURSOFF ((65536-32) | ((65536-32) << 16))
164 167
165/* The contents are unknown */ 168/* The contents are unknown */
166struct cg6_tec { 169struct cg6_tec {
@@ -280,6 +283,33 @@ static int cg6_sync(struct fb_info *info)
280 return 0; 283 return 0;
281} 284}
282 285
286static void cg6_switch_from_graph(struct cg6_par *par)
287{
288 struct cg6_thc __iomem *thc = par->thc;
289 unsigned long flags;
290
291 spin_lock_irqsave(&par->lock, flags);
292
293 /* Hide the cursor. */
294 sbus_writel(CG6_THC_CURSOFF, &thc->thc_cursxy);
295
296 spin_unlock_irqrestore(&par->lock, flags);
297}
298
299static int cg6_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
300{
301 struct cg6_par *par = (struct cg6_par *)info->par;
302
303 /* We just use this to catch switches out of
304 * graphics mode.
305 */
306 cg6_switch_from_graph(par);
307
308 if (var->xoffset || var->yoffset || var->vmode)
309 return -EINVAL;
310 return 0;
311}
312
283/** 313/**
284 * cg6_fillrect - Draws a rectangle on the screen. 314 * cg6_fillrect - Draws a rectangle on the screen.
285 * 315 *
@@ -643,9 +673,13 @@ static void __devinit cg6_chip_init(struct fb_info *info)
643 struct cg6_par *par = (struct cg6_par *)info->par; 673 struct cg6_par *par = (struct cg6_par *)info->par;
644 struct cg6_tec __iomem *tec = par->tec; 674 struct cg6_tec __iomem *tec = par->tec;
645 struct cg6_fbc __iomem *fbc = par->fbc; 675 struct cg6_fbc __iomem *fbc = par->fbc;
676 struct cg6_thc __iomem *thc = par->thc;
646 u32 rev, conf, mode; 677 u32 rev, conf, mode;
647 int i; 678 int i;
648 679
680 /* Hide the cursor. */
681 sbus_writel(CG6_THC_CURSOFF, &thc->thc_cursxy);
682
649 /* Turn off stuff in the Transform Engine. */ 683 /* Turn off stuff in the Transform Engine. */
650 sbus_writel(0, &tec->tec_matrix); 684 sbus_writel(0, &tec->tec_matrix);
651 sbus_writel(0, &tec->tec_clip); 685 sbus_writel(0, &tec->tec_clip);