aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/aty
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/aty')
-rw-r--r--drivers/video/aty/radeon_accel.c24
-rw-r--r--drivers/video/aty/radeon_base.c24
-rw-r--r--drivers/video/aty/radeonfb.h2
3 files changed, 40 insertions, 10 deletions
diff --git a/drivers/video/aty/radeon_accel.c b/drivers/video/aty/radeon_accel.c
index 8718f7349d6b..8da5e5ab8547 100644
--- a/drivers/video/aty/radeon_accel.c
+++ b/drivers/video/aty/radeon_accel.c
@@ -174,12 +174,12 @@ static void radeonfb_prim_imageblit(struct radeonfb_info *rinfo,
174 const struct fb_image *image, 174 const struct fb_image *image,
175 u32 fg, u32 bg) 175 u32 fg, u32 bg)
176{ 176{
177 unsigned int src_bytes, dwords; 177 unsigned int dwords;
178 u32 *bits; 178 u32 *bits;
179 179
180 radeonfb_set_creg(rinfo, DP_GUI_MASTER_CNTL, &rinfo->dp_gui_mc_cache, 180 radeonfb_set_creg(rinfo, DP_GUI_MASTER_CNTL, &rinfo->dp_gui_mc_cache,
181 rinfo->dp_gui_mc_base | 181 rinfo->dp_gui_mc_base |
182 GMC_BRUSH_NONE | 182 GMC_BRUSH_NONE | GMC_DST_CLIP_LEAVE |
183 GMC_SRC_DATATYPE_MONO_FG_BG | 183 GMC_SRC_DATATYPE_MONO_FG_BG |
184 ROP3_S | 184 ROP3_S |
185 GMC_BYTE_ORDER_MSB_TO_LSB | 185 GMC_BYTE_ORDER_MSB_TO_LSB |
@@ -189,9 +189,6 @@ static void radeonfb_prim_imageblit(struct radeonfb_info *rinfo,
189 radeonfb_set_creg(rinfo, DP_SRC_FRGD_CLR, &rinfo->dp_src_fg_cache, fg); 189 radeonfb_set_creg(rinfo, DP_SRC_FRGD_CLR, &rinfo->dp_src_fg_cache, fg);
190 radeonfb_set_creg(rinfo, DP_SRC_BKGD_CLR, &rinfo->dp_src_bg_cache, bg); 190 radeonfb_set_creg(rinfo, DP_SRC_BKGD_CLR, &rinfo->dp_src_bg_cache, bg);
191 191
192 radeon_fifo_wait(rinfo, 1);
193 OUTREG(DST_Y_X, (image->dy << 16) | image->dx);
194
195 /* Ensure the dst cache is flushed and the engine idle before 192 /* Ensure the dst cache is flushed and the engine idle before
196 * issuing the operation. 193 * issuing the operation.
197 * 194 *
@@ -205,13 +202,19 @@ static void radeonfb_prim_imageblit(struct radeonfb_info *rinfo,
205 202
206 /* X here pads width to a multiple of 32 and uses the clipper to 203 /* X here pads width to a multiple of 32 and uses the clipper to
207 * adjust the result. Is that really necessary ? Things seem to 204 * adjust the result. Is that really necessary ? Things seem to
208 * work ok for me without that and the doco doesn't seem to imply 205 * work ok for me without that and the doco doesn't seem to imply]
209 * there is such a restriction. 206 * there is such a restriction.
210 */ 207 */
211 OUTREG(DST_WIDTH_HEIGHT, (image->width << 16) | image->height); 208 radeon_fifo_wait(rinfo, 4);
209 OUTREG(SC_TOP_LEFT, (image->dy << 16) | image->dx);
210 OUTREG(SC_BOTTOM_RIGHT, ((image->dy + image->height) << 16) |
211 (image->dx + image->width));
212 OUTREG(DST_Y_X, (image->dy << 16) | image->dx);
213
214 OUTREG(DST_HEIGHT_WIDTH, (image->height << 16) | ((image->width + 31) & ~31));
212 215
213 src_bytes = (((image->width * image->depth) + 7) / 8) * image->height; 216 dwords = (image->width + 31) >> 5;
214 dwords = (src_bytes + 3) / 4; 217 dwords *= image->height;
215 bits = (u32*)(image->data); 218 bits = (u32*)(image->data);
216 219
217 while(dwords >= 8) { 220 while(dwords >= 8) {
@@ -253,7 +256,8 @@ void radeonfb_imageblit(struct fb_info *info, const struct fb_image *image)
253 return; 256 return;
254 257
255 /* We only do 1 bpp color expansion for now */ 258 /* We only do 1 bpp color expansion for now */
256 if (info->flags & FBINFO_HWACCEL_DISABLED || image->depth != 1) 259 if (!accel_cexp ||
260 (info->flags & FBINFO_HWACCEL_DISABLED) || image->depth != 1)
257 goto fallback; 261 goto fallback;
258 262
259 /* Fallback if running out of the screen. We may do clipping 263 /* Fallback if running out of the screen. We may do clipping
diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
index 9a5821c65ebf..d5b27f9d374d 100644
--- a/drivers/video/aty/radeon_base.c
+++ b/drivers/video/aty/radeon_base.c
@@ -282,6 +282,8 @@ static int backlight = 1;
282static int backlight = 0; 282static int backlight = 0;
283#endif 283#endif
284 284
285int accel_cexp = 0;
286
285/* 287/*
286 * prototypes 288 * prototypes
287 */ 289 */
@@ -1875,6 +1877,7 @@ static int __devinit radeon_set_fbinfo (struct radeonfb_info *rinfo)
1875 info->fbops = &radeonfb_ops; 1877 info->fbops = &radeonfb_ops;
1876 info->screen_base = rinfo->fb_base; 1878 info->screen_base = rinfo->fb_base;
1877 info->screen_size = rinfo->mapped_vram; 1879 info->screen_size = rinfo->mapped_vram;
1880
1878 /* Fill fix common fields */ 1881 /* Fill fix common fields */
1879 strlcpy(info->fix.id, rinfo->name, sizeof(info->fix.id)); 1882 strlcpy(info->fix.id, rinfo->name, sizeof(info->fix.id));
1880 info->fix.smem_start = rinfo->fb_base_phys; 1883 info->fix.smem_start = rinfo->fb_base_phys;
@@ -1889,8 +1892,25 @@ static int __devinit radeon_set_fbinfo (struct radeonfb_info *rinfo)
1889 info->fix.mmio_len = RADEON_REGSIZE; 1892 info->fix.mmio_len = RADEON_REGSIZE;
1890 info->fix.accel = FB_ACCEL_ATI_RADEON; 1893 info->fix.accel = FB_ACCEL_ATI_RADEON;
1891 1894
1895 /* Allocate colormap */
1892 fb_alloc_cmap(&info->cmap, 256, 0); 1896 fb_alloc_cmap(&info->cmap, 256, 0);
1893 1897
1898 /* Setup pixmap used for acceleration */
1899#define PIXMAP_SIZE (2048 * 4)
1900
1901 info->pixmap.addr = kmalloc(PIXMAP_SIZE, GFP_KERNEL);
1902 if (!info->pixmap.addr) {
1903 printk(KERN_ERR "radeonfb: Failed to allocate pixmap !\n");
1904 noaccel = 1;
1905 goto bail;
1906 }
1907 info->pixmap.size = PIXMAP_SIZE;
1908 info->pixmap.flags = FB_PIXMAP_SYSTEM;
1909 info->pixmap.scan_align = 4;
1910 info->pixmap.buf_align = 4;
1911 info->pixmap.access_align = 32;
1912
1913bail:
1894 if (noaccel) 1914 if (noaccel)
1895 info->flags |= FBINFO_HWACCEL_DISABLED; 1915 info->flags |= FBINFO_HWACCEL_DISABLED;
1896 1916
@@ -2502,6 +2522,8 @@ static int __init radeonfb_setup (char *options)
2502 } else if (!strncmp(this_opt, "ignore_devlist", 14)) { 2522 } else if (!strncmp(this_opt, "ignore_devlist", 14)) {
2503 ignore_devlist = 1; 2523 ignore_devlist = 1;
2504#endif 2524#endif
2525 } else if (!strncmp(this_opt, "accel_cexp", 12)) {
2526 accel_cexp = 1;
2505 } else 2527 } else
2506 mode_option = this_opt; 2528 mode_option = this_opt;
2507 } 2529 }
@@ -2549,6 +2571,8 @@ module_param(monitor_layout, charp, 0);
2549MODULE_PARM_DESC(monitor_layout, "Specify monitor mapping (like XFree86)"); 2571MODULE_PARM_DESC(monitor_layout, "Specify monitor mapping (like XFree86)");
2550module_param(force_measure_pll, bool, 0); 2572module_param(force_measure_pll, bool, 0);
2551MODULE_PARM_DESC(force_measure_pll, "Force measurement of PLL (debug)"); 2573MODULE_PARM_DESC(force_measure_pll, "Force measurement of PLL (debug)");
2574module_param(accel_cexp, bool, 0);
2575MODULE_PARM_DESC(accel_cexp, "Use acceleration engine for color expansion");
2552#ifdef CONFIG_MTRR 2576#ifdef CONFIG_MTRR
2553module_param(nomtrr, bool, 0); 2577module_param(nomtrr, bool, 0);
2554MODULE_PARM_DESC(nomtrr, "bool: disable use of MTRR registers"); 2578MODULE_PARM_DESC(nomtrr, "bool: disable use of MTRR registers");
diff --git a/drivers/video/aty/radeonfb.h b/drivers/video/aty/radeonfb.h
index ea0b5b47acaf..974ca6d86540 100644
--- a/drivers/video/aty/radeonfb.h
+++ b/drivers/video/aty/radeonfb.h
@@ -638,4 +638,6 @@ static inline void radeonfb_bl_init(struct radeonfb_info *rinfo) {}
638static inline void radeonfb_bl_exit(struct radeonfb_info *rinfo) {} 638static inline void radeonfb_bl_exit(struct radeonfb_info *rinfo) {}
639#endif 639#endif
640 640
641extern int accel_cexp;
642
641#endif /* __RADEONFB_H__ */ 643#endif /* __RADEONFB_H__ */