forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 95099d4622f8cb224d94e314c7a8e0df60b13f87
kernel/drivers/video/fbdev/g364fb.c
....@@ -108,10 +108,9 @@
108108 static int g364fb_setcolreg(u_int regno, u_int red, u_int green,
109109 u_int blue, u_int transp,
110110 struct fb_info *info);
111
-static int g364fb_cursor(struct fb_info *info, struct fb_cursor *cursor);
112111 static int g364fb_blank(int blank, struct fb_info *info);
113112
114
-static struct fb_ops g364fb_ops = {
113
+static const struct fb_ops g364fb_ops = {
115114 .owner = THIS_MODULE,
116115 .fb_setcolreg = g364fb_setcolreg,
117116 .fb_pan_display = g364fb_pan_display,
....@@ -119,27 +118,7 @@
119118 .fb_fillrect = cfb_fillrect,
120119 .fb_copyarea = cfb_copyarea,
121120 .fb_imageblit = cfb_imageblit,
122
- .fb_cursor = g364fb_cursor,
123121 };
124
-
125
-int g364fb_cursor(struct fb_info *info, struct fb_cursor *cursor)
126
-{
127
-
128
- switch (cursor->enable) {
129
- case CM_ERASE:
130
- *(unsigned int *) CTLA_REG |= CURS_TOGGLE;
131
- break;
132
-
133
- case CM_MOVE:
134
- case CM_DRAW:
135
- *(unsigned int *) CTLA_REG &= ~CURS_TOGGLE;
136
- *(unsigned int *) CURS_POS_REG =
137
- ((x * fontwidth(p)) << 12) | ((y * fontheight(p)) -
138
- info->var.yoffset);
139
- break;
140
- }
141
- return 0;
142
-}
143122
144123 /*
145124 * Pan or Wrap the Display
....@@ -194,11 +173,9 @@
194173 */
195174 int __init g364fb_init(void)
196175 {
197
- volatile unsigned int *pal_ptr =
198
- (volatile unsigned int *) CLR_PAL_REG;
199176 volatile unsigned int *curs_pal_ptr =
200177 (volatile unsigned int *) CURS_PAL_REG;
201
- int mem, i, j;
178
+ int mem, i;
202179
203180 if (fb_get_options("g364fb", NULL))
204181 return -ENODEV;
....@@ -230,8 +207,8 @@
230207 */
231208 *(unsigned short *) (CURS_PAT_REG + 14 * 64) = 0xffff;
232209 *(unsigned short *) (CURS_PAT_REG + 15 * 64) = 0xffff;
233
- fb_var.xres_virtual = fbvar.xres;
234
- fb_fix.line_length = (xres / 8) * fb_var.bits_per_pixel;
210
+ fb_var.xres_virtual = fb_var.xres;
211
+ fb_fix.line_length = fb_var.xres_virtual * fb_var.bits_per_pixel / 8;
235212 fb_fix.smem_start = 0x40000000; /* physical address */
236213 /* get size of video memory; this is special for the JAZZ hardware */
237214 mem = (r4030_read_reg32(JAZZ_R4030_CONFIG) >> 8) & 3;