hardware/menlow/psb
Revision | f983cf76dd092c91eb0820d9fc59a96ed6581470 (tree) |
---|---|
Time | 2010-08-05 20:15:30 |
Author | Owen Kwon <pinebud@gmai...> |
Commiter | Owen Kwon |
copied psb_fb.c from 2.6.32
@@ -32,14 +32,14 @@ | ||
32 | 32 | #include <linux/init.h> |
33 | 33 | #include <linux/console.h> |
34 | 34 | |
35 | -#define BUFFER_COUNT 2 | |
36 | - | |
37 | 35 | #include "drmP.h" |
38 | 36 | #include "drm.h" |
39 | 37 | #include "drm_crtc.h" |
40 | 38 | #include "psb_drv.h" |
41 | 39 | #include "drm_compat.h" |
42 | 40 | |
41 | +#define BUFFER_COUNT 2 | |
42 | + | |
43 | 43 | #define SII_1392_WA |
44 | 44 | #ifdef SII_1392_WA |
45 | 45 | extern int SII_1392; |
@@ -104,8 +104,7 @@ static int psbfb_setcolreg(unsigned regno, unsigned red, unsigned green, | ||
104 | 104 | if (regno > 15) |
105 | 105 | return 1; |
106 | 106 | |
107 | - /* | |
108 | - * //this sets gamma of psb and it ruins color | |
107 | + /* why do we set gamma here? this ruins color setting -_-? | |
109 | 108 | if (crtc->funcs->gamma_set) |
110 | 109 | crtc->funcs->gamma_set(crtc, red, green, blue, regno); |
111 | 110 | */ |
@@ -133,13 +132,11 @@ static int psbfb_setcolreg(unsigned regno, unsigned red, unsigned green, | ||
133 | 132 | return 0; |
134 | 133 | } |
135 | 134 | |
135 | +/* copied from general drm_fb_helper */ | |
136 | 136 | static int psbfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) |
137 | 137 | { |
138 | 138 | struct psbfb_par *par = info->par; |
139 | - struct drm_device *dev = par->dev; | |
140 | 139 | struct drm_framebuffer *fb = par->crtc->fb; |
141 | - struct drm_display_mode *drm_mode; | |
142 | - struct drm_output *output; | |
143 | 140 | int depth; |
144 | 141 | int pitch; |
145 | 142 | int bpp = var->bits_per_pixel; |
@@ -150,155 +147,92 @@ static int psbfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | ||
150 | 147 | if (!var->pixclock) |
151 | 148 | return -EINVAL; |
152 | 149 | |
153 | - /* don't support virtuals for now */ | |
154 | 150 | #if (BUFFER_COUNT == 1) |
155 | - if (var->xres_virtual > var->xres) | |
151 | + if (var->yres < var->yres_virtual) | |
156 | 152 | return -EINVAL; |
157 | - | |
158 | - if (var->yres_virtual > var->yres) | |
153 | + if (var->xres < var->xres_virtual) | |
159 | 154 | return -EINVAL; |
160 | 155 | #endif |
161 | 156 | |
162 | 157 | switch (bpp) { |
163 | - case 8: | |
164 | - depth = 8; | |
165 | - break; | |
166 | - case 16: | |
167 | - depth = (var->green.length == 6) ? 16 : 15; | |
168 | - break; | |
169 | - case 24: /* assume this is 32bpp / depth 24 */ | |
170 | - bpp = 32; | |
171 | - /* fallthrough */ | |
172 | - case 32: | |
173 | - depth = (var->transp.length > 0) ? 32 : 24; | |
174 | - break; | |
175 | - default: | |
176 | - return -EINVAL; | |
158 | + case 8: | |
159 | + depth = 8; | |
160 | + break; | |
161 | + case 16: | |
162 | + depth = (var->green.length == 6) ? 16 : 15; | |
163 | + break; | |
164 | + case 24: /* assume this is 32bpp / depth 24 */ | |
165 | + bpp = 32; | |
166 | + /* fallthrough */ | |
167 | + case 32: | |
168 | + depth = (var->transp.length > 0) ? 32 : 24; | |
169 | + break; | |
170 | + default: | |
171 | + return -EINVAL; | |
177 | 172 | } |
178 | 173 | |
179 | 174 | pitch = ((var->xres * ((bpp + 1) / 8)) + 0x3f) & ~0x3f; |
180 | 175 | |
181 | - /* Check that we can resize */ | |
182 | 176 | if ((pitch * var->yres) > (fb->bo->num_pages << PAGE_SHIFT)) { |
183 | -#if 1 | |
184 | - /* Need to resize the fb object. | |
185 | - * But the generic fbdev code doesn't really understand | |
186 | - * that we can do this. So disable for now. | |
187 | - */ | |
188 | 177 | DRM_INFO("Can't support requested size, too big!\n"); |
189 | 178 | return -EINVAL; |
190 | -#else | |
191 | - int ret; | |
192 | - struct drm_buffer_object *fbo = NULL; | |
193 | - struct drm_bo_kmap_obj tmp_kmap; | |
194 | - | |
195 | - /* a temporary BO to check if we could resize in setpar. | |
196 | - * Therefore no need to set NO_EVICT. | |
197 | - */ | |
198 | - ret = drm_buffer_object_create(dev, | |
199 | - pitch * var->yres, | |
200 | - drm_bo_type_kernel, | |
201 | - DRM_BO_FLAG_READ | | |
202 | - DRM_BO_FLAG_WRITE | | |
203 | - DRM_BO_FLAG_MEM_TT | | |
204 | - DRM_BO_FLAG_MEM_VRAM, | |
205 | - DRM_BO_HINT_DONT_FENCE, | |
206 | - 0, 0, &fbo); | |
207 | - if (ret || !fbo) | |
208 | - return -ENOMEM; | |
209 | - | |
210 | - ret = drm_bo_kmap(fbo, 0, fbo->num_pages, &tmp_kmap); | |
211 | - if (ret) { | |
212 | - drm_bo_usage_deref_unlocked(&fbo); | |
213 | - return -EINVAL; | |
214 | - } | |
215 | - | |
216 | - drm_bo_kunmap(&tmp_kmap); | |
217 | - /* destroy our current fbo! */ | |
218 | - drm_bo_usage_deref_unlocked(&fbo); | |
219 | -#endif | |
220 | 179 | } |
221 | 180 | |
222 | 181 | switch (depth) { |
223 | - case 8: | |
224 | - var->red.offset = 0; | |
225 | - var->green.offset = 0; | |
226 | - var->blue.offset = 0; | |
227 | - var->red.length = 8; | |
228 | - var->green.length = 8; | |
229 | - var->blue.length = 8; | |
230 | - var->transp.length = 0; | |
231 | - var->transp.offset = 0; | |
232 | - break; | |
233 | - case 15: | |
234 | - var->red.offset = 10; | |
235 | - var->green.offset = 5; | |
236 | - var->blue.offset = 0; | |
237 | - var->red.length = 5; | |
238 | - var->green.length = 5; | |
239 | - var->blue.length = 5; | |
240 | - var->transp.length = 1; | |
241 | - var->transp.offset = 15; | |
242 | - break; | |
243 | - case 16: | |
244 | - var->red.offset = 11; | |
245 | - var->green.offset = 5; | |
246 | - var->blue.offset = 0; | |
247 | - var->red.length = 5; | |
248 | - var->green.length = 6; | |
249 | - var->blue.length = 5; | |
250 | - var->transp.length = 0; | |
251 | - var->transp.offset = 0; | |
252 | - break; | |
253 | - case 24: | |
254 | - var->red.offset = 16; | |
255 | - var->green.offset = 8; | |
256 | - var->blue.offset = 0; | |
257 | - var->red.length = 8; | |
258 | - var->green.length = 8; | |
259 | - var->blue.length = 8; | |
260 | - var->transp.length = 0; | |
261 | - var->transp.offset = 0; | |
262 | - break; | |
263 | - case 32: | |
264 | - var->red.offset = 16; | |
265 | - var->green.offset = 8; | |
266 | - var->blue.offset = 0; | |
267 | - var->red.length = 8; | |
268 | - var->green.length = 8; | |
269 | - var->blue.length = 8; | |
270 | - var->transp.length = 8; | |
271 | - var->transp.offset = 24; | |
272 | - break; | |
273 | - default: | |
274 | - return -EINVAL; | |
275 | - } | |
276 | - | |
277 | -#if 0 | |
278 | - /* Here we walk the output mode list and look for modes. If we haven't | |
279 | - * got it, then bail. Not very nice, so this is disabled. | |
280 | - * In the set_par code, we create our mode based on the incoming | |
281 | - * parameters. Nicer, but may not be desired by some. | |
282 | - */ | |
283 | - list_for_each_entry(output, &dev->mode_config.output_list, head) { | |
284 | - if (output->crtc == par->crtc) | |
182 | + case 8: | |
183 | + var->red.offset = 0; | |
184 | + var->green.offset = 0; | |
185 | + var->blue.offset = 0; | |
186 | + var->red.length = 8; | |
187 | + var->green.length = 8; | |
188 | + var->blue.length = 8; | |
189 | + var->transp.length = 0; | |
190 | + var->transp.offset = 0; | |
285 | 191 | break; |
286 | - } | |
287 | - | |
288 | - list_for_each_entry(drm_mode, &output->modes, head) { | |
289 | - if (drm_mode->hdisplay == var->xres && | |
290 | - drm_mode->vdisplay == var->yres && drm_mode->clock != 0) | |
192 | + case 15: | |
193 | + var->red.offset = 10; | |
194 | + var->green.offset = 5; | |
195 | + var->blue.offset = 0; | |
196 | + var->red.length = 5; | |
197 | + var->green.length = 5; | |
198 | + var->blue.length = 5; | |
199 | + var->transp.length = 1; | |
200 | + var->transp.offset = 15; | |
291 | 201 | break; |
202 | + case 16: | |
203 | + var->red.offset = 11; | |
204 | + var->green.offset = 5; | |
205 | + var->blue.offset = 0; | |
206 | + var->red.length = 5; | |
207 | + var->green.length = 6; | |
208 | + var->blue.length = 5; | |
209 | + var->transp.length = 0; | |
210 | + var->transp.offset = 0; | |
211 | + break; | |
212 | + case 24: | |
213 | + var->red.offset = 16; | |
214 | + var->green.offset = 8; | |
215 | + var->blue.offset = 0; | |
216 | + var->red.length = 8; | |
217 | + var->green.length = 8; | |
218 | + var->blue.length = 8; | |
219 | + var->transp.length = 0; | |
220 | + var->transp.offset = 0; | |
221 | + break; | |
222 | + case 32: | |
223 | + var->red.offset = 16; | |
224 | + var->green.offset = 8; | |
225 | + var->blue.offset = 0; | |
226 | + var->red.length = 8; | |
227 | + var->green.length = 8; | |
228 | + var->blue.length = 8; | |
229 | + var->transp.length = 8; | |
230 | + var->transp.offset = 24; | |
231 | + break; | |
232 | + default: | |
233 | + return -EINVAL; | |
292 | 234 | } |
293 | 235 | |
294 | - if (!drm_mode) | |
295 | - return -EINVAL; | |
296 | -#else | |
297 | - (void)dev; /* silence warnings */ | |
298 | - (void)output; | |
299 | - (void)drm_mode; | |
300 | -#endif | |
301 | - | |
302 | 236 | return 0; |
303 | 237 | } |
304 | 238 |
@@ -331,9 +265,14 @@ static int psbfb_move_fb_bo(struct fb_info *info, struct drm_buffer_object *bo, | ||
331 | 265 | return ret; |
332 | 266 | } |
333 | 267 | |
334 | -static int psbfb_set_par_ex(struct fb_info * info) | |
268 | +extern void | |
269 | +intel_pipe_set_base(struct drm_crtc *crtc, int x, int y); | |
270 | + | |
271 | +static int psbfb_set_par_ext(struct fb_info *info) | |
335 | 272 | { |
336 | 273 | /* need to populate */ |
274 | + | |
275 | + return 0; | |
337 | 276 | } |
338 | 277 | |
339 | 278 | /* this will let fbcon do the mode init */ |
@@ -373,55 +312,12 @@ static int psbfb_set_par(struct fb_info *info) | ||
373 | 312 | pitch = ((var->xres * ((bpp + 1) / 8)) + 0x3f) & ~0x3f; |
374 | 313 | |
375 | 314 | if ((pitch * var->yres) > (fb->bo->num_pages << PAGE_SHIFT)) { |
376 | -#if 1 | |
377 | 315 | /* Need to resize the fb object. |
378 | 316 | * But the generic fbdev code doesn't really understand |
379 | 317 | * that we can do this. So disable for now. |
380 | 318 | */ |
381 | 319 | DRM_INFO("Can't support requested size, too big!\n"); |
382 | 320 | return -EINVAL; |
383 | -#else | |
384 | - int ret; | |
385 | - struct drm_buffer_object *fbo = NULL, *tfbo; | |
386 | - struct drm_bo_kmap_obj tmp_kmap, tkmap; | |
387 | - | |
388 | - ret = drm_buffer_object_create(dev, | |
389 | - pitch * var->yres, | |
390 | - drm_bo_type_kernel, | |
391 | - DRM_BO_FLAG_READ | | |
392 | - DRM_BO_FLAG_WRITE | | |
393 | - DRM_BO_FLAG_MEM_TT | | |
394 | - DRM_BO_FLAG_MEM_VRAM | | |
395 | - DRM_BO_FLAG_NO_EVICT, | |
396 | - DRM_BO_HINT_DONT_FENCE, | |
397 | - 0, 0, &fbo); | |
398 | - if (ret || !fbo) { | |
399 | - DRM_ERROR | |
400 | - ("failed to allocate new resized framebuffer\n"); | |
401 | - return -ENOMEM; | |
402 | - } | |
403 | - | |
404 | - ret = drm_bo_kmap(fbo, 0, fbo->num_pages, &tmp_kmap); | |
405 | - if (ret) { | |
406 | - DRM_ERROR("failed to kmap framebuffer.\n"); | |
407 | - drm_bo_usage_deref_unlocked(&fbo); | |
408 | - return -EINVAL; | |
409 | - } | |
410 | - | |
411 | - DRM_DEBUG("allocated %dx%d fb: 0x%08lx, bo %p\n", fb->width, | |
412 | - fb->height, fb->offset, fbo); | |
413 | - | |
414 | - /* set new screen base */ | |
415 | - info->screen_base = tmp_kmap.virtual; | |
416 | - | |
417 | - tkmap = fb->kmap; | |
418 | - fb->kmap = tmp_kmap; | |
419 | - drm_bo_kunmap(&tkmap); | |
420 | - | |
421 | - tfbo = fb->bo; | |
422 | - fb->bo = fbo; | |
423 | - drm_bo_usage_deref_unlocked(&tfbo); | |
424 | -#endif | |
425 | 321 | } |
426 | 322 | |
427 | 323 | fb->offset = fb->bo->offset - dev_priv->pg->gatt_start; |
@@ -439,34 +335,11 @@ static int psbfb_set_par(struct fb_info *info) | ||
439 | 335 | info->fix.smem_start = dev->mode_config.fb_base + fb->offset; |
440 | 336 | |
441 | 337 | /* we have to align the output base address because the fb->bo |
442 | - may be moved in the previous drm_bo_do_validate(). | |
338 | + may be moved in the previous psb_drm_bo_do_validate(). | |
443 | 339 | Otherwise the output screens may go black when exit the X |
444 | 340 | window and re-enter the console */ |
445 | 341 | info->screen_base = fb->kmap.virtual; |
446 | 342 | |
447 | -#if 0 | |
448 | - /* relates to resize - disable */ | |
449 | - info->fix.smem_len = info->fix.line_length * var->yres; | |
450 | - info->screen_size = info->fix.smem_len; /* ??? */ | |
451 | -#endif | |
452 | - | |
453 | - /* Should we walk the output's modelist or just create our own ??? | |
454 | - * For now, we create and destroy a mode based on the incoming | |
455 | - * parameters. But there's commented out code below which scans | |
456 | - * the output list too. | |
457 | - */ | |
458 | -#if 0 | |
459 | - list_for_each_entry(output, &dev->mode_config.output_list, head) { | |
460 | - if (output->crtc == par->crtc) | |
461 | - break; | |
462 | - } | |
463 | - | |
464 | - list_for_each_entry(drm_mode, &output->modes, head) { | |
465 | - if (drm_mode->hdisplay == var->xres && | |
466 | - drm_mode->vdisplay == var->yres && drm_mode->clock != 0) | |
467 | - break; | |
468 | - } | |
469 | -#else | |
470 | 343 | (void)output; /* silence warning */ |
471 | 344 | |
472 | 345 | drm_mode = drm_mode_create(dev); |
@@ -482,7 +355,6 @@ static int psbfb_set_par(struct fb_info *info) | ||
482 | 355 | drm_mode->vrefresh = drm_mode_vrefresh(drm_mode); |
483 | 356 | drm_mode_set_name(drm_mode); |
484 | 357 | drm_mode_set_crtcinfo(drm_mode, CRTC_INTERLACE_HALVE_V); |
485 | -#endif | |
486 | 358 | |
487 | 359 | if (!drm_crtc_set_mode(par->crtc, drm_mode, 0, 0)) |
488 | 360 | return -EINVAL; |
@@ -998,74 +870,22 @@ void psbfb_resume(struct drm_device *dev) | ||
998 | 870 | } |
999 | 871 | |
1000 | 872 | /* |
1001 | - * FIXME: Before kernel inclusion, migrate nopfn to fault. | |
1002 | - * Also, these should be the default vm ops for buffer object type fbs. | |
1003 | - */ | |
1004 | - | |
1005 | -extern unsigned long drm_bo_vm_nopfn(struct vm_area_struct *vma, | |
1006 | - unsigned long address); | |
1007 | - | |
1008 | -/* | |
1009 | 873 | * This wrapper is a bit ugly and is here because we need access to a mutex |
1010 | 874 | * that we can lock both around nopfn and around unmap_mapping_range + move. |
1011 | 875 | * Normally, this would've been done using the bo mutex, but unfortunately |
1012 | - * we cannot lock it around drm_bo_do_validate(), since that would imply | |
876 | + * we cannot lock it around psb_drm_bo_do_validate(), since that would imply | |
1013 | 877 | * recursive locking. |
1014 | 878 | */ |
1015 | 879 | |
1016 | -static unsigned long psbfb_nopfn(struct vm_area_struct *vma, | |
1017 | - unsigned long address) | |
1018 | -{ | |
1019 | - struct psbfb_vm_info *vi = (struct psbfb_vm_info *)vma->vm_private_data; | |
1020 | - struct vm_area_struct tmp_vma; | |
1021 | - unsigned long ret; | |
1022 | - | |
1023 | - mutex_lock(&vi->vm_mutex); | |
1024 | - tmp_vma = *vma; | |
1025 | - tmp_vma.vm_private_data = vi->bo; | |
1026 | - ret = drm_bo_vm_nopfn(&tmp_vma, address); | |
1027 | - mutex_unlock(&vi->vm_mutex); | |
1028 | - return ret; | |
1029 | -} | |
1030 | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) | |
1031 | -static int psbfb_fault(struct vm_area_struct *vma, | |
1032 | - struct vm_fault *vmf) | |
1033 | -{ | |
1034 | - struct psbfb_vm_info *vi = (struct psbfb_vm_info *)vma->vm_private_data; | |
1035 | - struct vm_area_struct tmp_vma; | |
1036 | - unsigned long ret; | |
1037 | - | |
1038 | - unsigned long address = (unsigned long)vmf->virtual_address; | |
1039 | - | |
1040 | - mutex_lock(&vi->vm_mutex); | |
1041 | - tmp_vma = *vma; | |
1042 | - tmp_vma.vm_private_data = vi->bo; | |
1043 | - ret = drm_bo_vm_nopfn(&tmp_vma, address); | |
1044 | - mutex_unlock(&vi->vm_mutex); | |
1045 | - return ret; | |
1046 | -} | |
1047 | -#endif | |
1048 | -static void psbfb_vm_open(struct vm_area_struct *vma) | |
1049 | -{ | |
1050 | - struct psbfb_vm_info *vi = (struct psbfb_vm_info *)vma->vm_private_data; | |
1051 | - | |
1052 | - atomic_inc(&vi->refcount); | |
1053 | -} | |
1054 | - | |
1055 | -static void psbfb_vm_close(struct vm_area_struct *vma) | |
1056 | -{ | |
1057 | - psbfb_vm_info_deref((struct psbfb_vm_info **)&vma->vm_private_data); | |
1058 | -} | |
1059 | - | |
1060 | 880 | extern int drm_bo_vm_fault(struct vm_area_struct *vma, |
1061 | - struct vm_fault *vmf); | |
881 | + struct vm_fault *vmf); | |
1062 | 882 | extern void drm_bo_vm_open(struct vm_area_struct *vma); |
1063 | 883 | extern void drm_bo_vm_close(struct vm_area_struct *vma); |
1064 | 884 | |
1065 | 885 | static struct vm_operations_struct psbfb_vm_ops = { |
1066 | 886 | .fault = drm_bo_vm_fault, |
1067 | - .open = drm_bo_vm_open, | |
1068 | - .close = drm_bo_vm_close, | |
887 | + .open = drm_bo_vm_open, /* unused ?? */ | |
888 | + .close = drm_bo_vm_close, /* unused ?? */ | |
1069 | 889 | }; |
1070 | 890 | |
1071 | 891 | static int psbfb_mmap(struct fb_info *info, struct vm_area_struct *vma) |
@@ -1088,10 +908,10 @@ static int psbfb_mmap(struct fb_info *info, struct vm_area_struct *vma) | ||
1088 | 908 | par->vi->f_mapping = vma->vm_file->f_mapping; |
1089 | 909 | mutex_unlock(&par->vi->vm_mutex); |
1090 | 910 | |
911 | + vma->vm_private_data = par->vi->bo; | |
1091 | 912 | vma->vm_ops = &psbfb_vm_ops; |
1092 | 913 | vma->vm_flags |= VM_PFNMAP; |
1093 | - vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags)) ; | |
1094 | - | |
914 | + vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags)); | |
1095 | 915 | |
1096 | 916 | return 0; |
1097 | 917 | } |
@@ -1108,13 +928,12 @@ int psbfb_sync(struct fb_info *info) | ||
1108 | 928 | return 0; |
1109 | 929 | } |
1110 | 930 | |
1111 | -extern void intel_pipe_set_base(struct drm_crtc *crtc, int x,int y); | |
1112 | -int psbfb_pan_display (struct fb_var_screeninfo *var, struct fb_info *info) | |
931 | +int psbfb_pan_display (struct fb_var_screeninfo * var, struct fb_info *info) | |
1113 | 932 | { |
1114 | 933 | struct psbfb_par *par = info->par; |
1115 | 934 | |
1116 | 935 | intel_pipe_set_base (par->crtc, var->xoffset, var->yoffset); |
1117 | - msleep(1); | |
936 | + msleep(1); // weird? : we need to change the base actually ?? | |
1118 | 937 | |
1119 | 938 | return 0; |
1120 | 939 | } |
@@ -1122,7 +941,7 @@ int psbfb_pan_display (struct fb_var_screeninfo *var, struct fb_info *info) | ||
1122 | 941 | static struct fb_ops psbfb_ops = { |
1123 | 942 | .owner = THIS_MODULE, |
1124 | 943 | .fb_check_var = psbfb_check_var, |
1125 | - .fb_set_par = psbfb_set_par_ex, | |
944 | + .fb_set_par = psbfb_set_par_ext, | |
1126 | 945 | .fb_setcolreg = psbfb_setcolreg, |
1127 | 946 | .fb_fillrect = psbfb_fillrect, |
1128 | 947 | .fb_copyarea = psbfb_copyarea, |
@@ -1169,6 +988,10 @@ int psbfb_probe(struct drm_device *dev, struct drm_crtc *crtc) | ||
1169 | 988 | fb->width = mode->hdisplay; |
1170 | 989 | fb->height = mode->vdisplay; |
1171 | 990 | |
991 | + /* | |
992 | + fb->bits_per_pixel = 32; | |
993 | + fb->depth = 24; | |
994 | + */ | |
1172 | 995 | fb->bits_per_pixel = 16; |
1173 | 996 | fb->depth = 16; |
1174 | 997 | fb->pitch = |
@@ -1177,7 +1000,7 @@ int psbfb_probe(struct drm_device *dev, struct drm_crtc *crtc) | ||
1177 | 1000 | ALIGN(size, PAGE_SIZE); |
1178 | 1001 | |
1179 | 1002 | ret = drm_buffer_object_create(dev, |
1180 | - size, | |
1003 | + size, | |
1181 | 1004 | drm_bo_type_kernel, |
1182 | 1005 | DRM_BO_FLAG_READ | |
1183 | 1006 | DRM_BO_FLAG_WRITE | |
@@ -1192,7 +1015,7 @@ int psbfb_probe(struct drm_device *dev, struct drm_crtc *crtc) | ||
1192 | 1015 | |
1193 | 1016 | fb->offset = fbo->offset - dev_priv->pg->gatt_start; |
1194 | 1017 | fb->bo = fbo; |
1195 | - DRM_DEBUG("allocated %dx%d fb: 0x%08lx, bo %p\n", fb->width, | |
1018 | + DRM_INFO("allocated %dx%d fb: 0x%08lx, bo %p\n", fb->width, | |
1196 | 1019 | fb->height, fb->offset, fbo); |
1197 | 1020 | |
1198 | 1021 | fb->fbdev = info; |
@@ -1228,8 +1051,9 @@ int psbfb_probe(struct drm_device *dev, struct drm_crtc *crtc) | ||
1228 | 1051 | info->fix.smem_start = dev->mode_config.fb_base + fb->offset; |
1229 | 1052 | info->fix.smem_len = size; |
1230 | 1053 | |
1231 | - info->flags = FBINFO_DEFAULT | | |
1232 | - FBINFO_PARTIAL_PAN_OK /*| FBINFO_MISC_ALWAYS_SETPAR */ ; | |
1054 | + info->flags = FBINFO_DEFAULT | FBINFO_PARTIAL_PAN_OK | | |
1055 | + FBINFO_HWACCEL_COPYAREA | FBINFO_HWACCEL_FILLRECT | | |
1056 | + FBINFO_HWACCEL_IMAGEBLIT; | |
1233 | 1057 | |
1234 | 1058 | ret = drm_bo_kmap(fb->bo, 0, fb->bo->num_pages, &fb->kmap); |
1235 | 1059 | if (ret) { |