forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/video/fbdev/aty/atyfb.h
....@@ -147,6 +147,7 @@
147147 u16 pci_id;
148148 u32 accel_flags;
149149 int blitter_may_be_busy;
150
+ unsigned fifo_space;
150151 int asleep;
151152 int lock_blank;
152153 unsigned long res_start;
....@@ -286,8 +287,8 @@
286287 #endif
287288 }
288289
289
-#if defined(CONFIG_PM) || defined(CONFIG_PMAC_BACKLIGHT) || \
290
-defined (CONFIG_FB_ATY_GENERIC_LCD) || defined (CONFIG_FB_ATY_BACKLIGHT)
290
+#if defined(CONFIG_PMAC_BACKLIGHT) || defined (CONFIG_FB_ATY_GENERIC_LCD) || \
291
+defined (CONFIG_FB_ATY_BACKLIGHT)
291292 extern void aty_st_lcd(int index, u32 val, const struct atyfb_par *par);
292293 extern u32 aty_ld_lcd(int index, const struct atyfb_par *par);
293294 #endif
....@@ -340,16 +341,19 @@
340341 * Hardware cursor support
341342 */
342343
343
-extern int aty_init_cursor(struct fb_info *info);
344
+extern int aty_init_cursor(struct fb_info *info, struct fb_ops *atyfb_ops);
344345
345346 /*
346347 * Hardware acceleration
347348 */
348349
349
-static inline void wait_for_fifo(u16 entries, const struct atyfb_par *par)
350
+static inline void wait_for_fifo(u16 entries, struct atyfb_par *par)
350351 {
351
- while ((aty_ld_le32(FIFO_STAT, par) & 0xffff) >
352
- ((u32) (0x8000 >> entries)));
352
+ unsigned fifo_space = par->fifo_space;
353
+ while (entries > fifo_space) {
354
+ fifo_space = 16 - fls(aty_ld_le32(FIFO_STAT, par) & 0xffff);
355
+ }
356
+ par->fifo_space = fifo_space - entries;
353357 }
354358
355359 static inline void wait_for_idle(struct atyfb_par *par)
....@@ -359,7 +363,7 @@
359363 par->blitter_may_be_busy = 0;
360364 }
361365
362
-extern void aty_reset_engine(const struct atyfb_par *par);
366
+extern void aty_reset_engine(struct atyfb_par *par);
363367 extern void aty_init_engine(struct atyfb_par *par, struct fb_info *info);
364368
365369 void atyfb_copyarea(struct fb_info *info, const struct fb_copyarea *area);