Android-x86
Fork
Spenden

  • R/O
  • HTTP
  • SSH
  • HTTPS

hardware-menlow-psb: Commit

hardware/menlow/psb


Commit MetaInfo

Revisioned4d28a7d93bcd1a54c99c398833e5ad56c956a1 (tree)
Zeit2010-07-10 16:57:52
AutorOwen Kwon <pinebud77@hotm...>
CommiterOwen Kwon

Log Message

applied new changes from 2.6.32 kernel

Ändern Zusammenfassung

Diff

--- a/drm_vm.c
+++ b/drm_vm.c
@@ -813,6 +813,8 @@ out_unlock:
813813 return ret;
814814 }
815815
816+EXPORT_SYMBOL(drm_bo_vm_fault);
817+
816818 int drm_bo_vm_nopfn(struct vm_area_struct *vma,
817819 struct vm_fault *vmf )
818820 {
@@ -1073,6 +1075,7 @@ EXPORT_SYMBOL(drm_bo_vm_nopfn);
10731075 mutex_unlock(&dev->struct_mutex);
10741076 }
10751077
1078+EXPORT_SYMBOL(drm_bo_vm_open);
10761079 /**
10771080 * \c vma close method for buffer objects.
10781081 *
@@ -1097,6 +1100,7 @@ EXPORT_SYMBOL(drm_bo_vm_nopfn);
10971100 return;
10981101 }
10991102
1103+EXPORT_SYMBOL(drm_bo_vm_close);
11001104 static struct vm_operations_struct drm_bo_vm_ops = {
11011105 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
11021106 .fault = drm_bo_vm_fault,
--- a/psb_fb.c
+++ b/psb_fb.c
@@ -32,6 +32,8 @@
3232 #include <linux/init.h>
3333 #include <linux/console.h>
3434
35+#define BUFFER_COUNT 2
36+
3537 #include "drmP.h"
3638 #include "drm.h"
3739 #include "drm_crtc.h"
@@ -102,8 +104,11 @@ static int psbfb_setcolreg(unsigned regno, unsigned red, unsigned green,
102104 if (regno > 15)
103105 return 1;
104106
107+ /*
108+ * //this sets gamma of psb and it ruins color
105109 if (crtc->funcs->gamma_set)
106110 crtc->funcs->gamma_set(crtc, red, green, blue, regno);
111+ */
107112
108113 red = CMAP_TOHW(red, info->var.red.length);
109114 blue = CMAP_TOHW(blue, info->var.blue.length);
@@ -146,11 +151,13 @@ static int psbfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
146151 return -EINVAL;
147152
148153 /* don't support virtuals for now */
154+#if (BUFFER_COUNT == 1)
149155 if (var->xres_virtual > var->xres)
150156 return -EINVAL;
151157
152158 if (var->yres_virtual > var->yres)
153159 return -EINVAL;
160+#endif
154161
155162 switch (bpp) {
156163 case 8:
@@ -324,6 +331,11 @@ static int psbfb_move_fb_bo(struct fb_info *info, struct drm_buffer_object *bo,
324331 return ret;
325332 }
326333
334+static int psbfb_set_par_ex(struct fb_info * info)
335+{
336+ /* need to populate */
337+}
338+
327339 /* this will let fbcon do the mode init */
328340 static int psbfb_set_par(struct fb_info *info)
329341 {
@@ -1045,14 +1057,15 @@ static void psbfb_vm_close(struct vm_area_struct *vma)
10451057 psbfb_vm_info_deref((struct psbfb_vm_info **)&vma->vm_private_data);
10461058 }
10471059
1060+extern int drm_bo_vm_fault(struct vm_area_struct *vma,
1061+ struct vm_fault *vmf);
1062+extern void drm_bo_vm_open(struct vm_area_struct *vma);
1063+extern void drm_bo_vm_close(struct vm_area_struct *vma);
1064+
10481065 static struct vm_operations_struct psbfb_vm_ops = {
1049- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
1050- .fault = psbfb_fault,
1051- #else
1052- .nopfn = psbfb_nopfn,
1053- #endif
1054- .open = psbfb_vm_open,
1055- .close = psbfb_vm_close,
1066+ .fault = drm_bo_vm_fault,
1067+ .open = drm_bo_vm_open,
1068+ .close = drm_bo_vm_close,
10561069 };
10571070
10581071 static int psbfb_mmap(struct fb_info *info, struct vm_area_struct *vma)
@@ -1075,10 +1088,10 @@ static int psbfb_mmap(struct fb_info *info, struct vm_area_struct *vma)
10751088 par->vi->f_mapping = vma->vm_file->f_mapping;
10761089 mutex_unlock(&par->vi->vm_mutex);
10771090
1078- vma->vm_private_data = psbfb_vm_info_ref(par->vi);
1079-
10801091 vma->vm_ops = &psbfb_vm_ops;
10811092 vma->vm_flags |= VM_PFNMAP;
1093+ vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags)) ;
1094+
10821095
10831096 return 0;
10841097 }
@@ -1095,20 +1108,26 @@ int psbfb_sync(struct fb_info *info)
10951108 return 0;
10961109 }
10971110
1098-int psbfb_pan_display (struct fb_info *info)
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)
10991113 {
1114+ struct psbfb_par *par = info->par;
1115+
1116+ intel_pipe_set_base (par->crtc, var->xoffset, var->yoffset);
1117+ msleep(1);
1118+
11001119 return 0;
11011120 }
11021121
11031122 static struct fb_ops psbfb_ops = {
11041123 .owner = THIS_MODULE,
11051124 .fb_check_var = psbfb_check_var,
1106- .fb_set_par = psbfb_set_par,
1125+ .fb_set_par = psbfb_set_par_ex,
11071126 .fb_setcolreg = psbfb_setcolreg,
11081127 .fb_fillrect = psbfb_fillrect,
11091128 .fb_copyarea = psbfb_copyarea,
11101129 .fb_imageblit = psbfb_imageblit,
1111-// .fb_mmap = psbfb_mmap,
1130+ .fb_mmap = psbfb_mmap,
11121131 .fb_sync = psbfb_sync,
11131132 .fb_blank = psbfb_blank,
11141133 .fb_pan_display = psbfb_pan_display,
@@ -1126,6 +1145,7 @@ int psbfb_probe(struct drm_device *dev, struct drm_crtc *crtc)
11261145 struct drm_buffer_object *fbo = NULL;
11271146 int ret;
11281147 int is_iomem;
1148+ int size;
11291149
11301150 if (drm_psb_no_fb) {
11311151 /* need to do this as the DRM will disable the output */
@@ -1153,9 +1173,11 @@ int psbfb_probe(struct drm_device *dev, struct drm_crtc *crtc)
11531173 fb->depth = 16;
11541174 fb->pitch =
11551175 ((fb->width * ((fb->bits_per_pixel + 1) / 8)) + 0x3f) & ~0x3f;
1176+ size = fb->pitch * fb->height * BUFFER_COUNT;
1177+ ALIGN(size, PAGE_SIZE);
11561178
11571179 ret = drm_buffer_object_create(dev,
1158- fb->pitch * fb->height,
1180+ size,
11591181 drm_bo_type_kernel,
11601182 DRM_BO_FLAG_READ |
11611183 DRM_BO_FLAG_WRITE |
@@ -1204,7 +1226,7 @@ int psbfb_probe(struct drm_device *dev, struct drm_crtc *crtc)
12041226 info->fix.mmio_len = 0;
12051227 info->fix.line_length = fb->pitch;
12061228 info->fix.smem_start = dev->mode_config.fb_base + fb->offset;
1207- info->fix.smem_len = info->fix.line_length * fb->height;
1229+ info->fix.smem_len = size;
12081230
12091231 info->flags = FBINFO_DEFAULT |
12101232 FBINFO_PARTIAL_PAN_OK /*| FBINFO_MISC_ALWAYS_SETPAR */ ;
@@ -1216,11 +1238,11 @@ int psbfb_probe(struct drm_device *dev, struct drm_crtc *crtc)
12161238 }
12171239
12181240 info->screen_base = drm_bmo_virtual(&fb->kmap, &is_iomem);
1219- memset(info->screen_base, 0x00, fb->pitch*fb->height);
1241+ memset(info->screen_base, 0x00, size);
12201242 info->screen_size = info->fix.smem_len; /* FIXME */
12211243 info->pseudo_palette = fb->pseudo_palette;
12221244 info->var.xres_virtual = fb->width;
1223- info->var.yres_virtual = fb->height;
1245+ info->var.yres_virtual = fb->height * BUFFER_COUNT;
12241246 info->var.bits_per_pixel = fb->bits_per_pixel;
12251247 info->var.xoffset = 0;
12261248 info->var.yoffset = 0;
Show on old repository browser