Subversion Repositories Kolibri OS

Rev

Rev 2336 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2336 Rev 2342
Line 91... Line 91...
91
{
91
{
92
	struct drm_device *dev = ifbdev->helper.dev;
92
	struct drm_device *dev = ifbdev->helper.dev;
93
	struct drm_i915_private *dev_priv = dev->dev_private;
93
	struct drm_i915_private *dev_priv = dev->dev_private;
94
	struct fb_info *info;
94
	struct fb_info *info;
95
	struct drm_framebuffer *fb;
95
	struct drm_framebuffer *fb;
96
	struct drm_mode_fb_cmd mode_cmd;
96
	struct drm_mode_fb_cmd2 mode_cmd;
97
	struct drm_i915_gem_object *obj;
97
	struct drm_i915_gem_object *obj;
98
	struct device *device = &dev->pdev->dev;
98
	struct device *device = &dev->pdev->dev;
99
	int size, ret;
99
	int size, ret;
Line 100... Line 100...
100
 
100
 
Line 103... Line 103...
103
		sizes->surface_bpp = 32;
103
		sizes->surface_bpp = 32;
Line 104... Line 104...
104
 
104
 
105
	mode_cmd.width = sizes->surface_width;
105
	mode_cmd.width = sizes->surface_width;
Line 106... Line 106...
106
	mode_cmd.height = sizes->surface_height;
106
	mode_cmd.height = sizes->surface_height;
-
 
107
 
107
 
108
	mode_cmd.pitches[0] = ALIGN(mode_cmd.width * ((sizes->surface_bpp + 7) /
108
	mode_cmd.bpp = sizes->surface_bpp;
109
						      8), 64);
Line 109... Line 110...
109
	mode_cmd.pitch = ALIGN(mode_cmd.width * ((mode_cmd.bpp + 7) / 8), 64);
110
	mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp,
110
	mode_cmd.depth = sizes->surface_depth;
111
							  sizes->surface_depth);
111
 
112
 
112
	size = mode_cmd.pitch * mode_cmd.height;
113
	size = mode_cmd.pitches[0] * mode_cmd.height;
113
	size = ALIGN(size, PAGE_SIZE);
114
	size = ALIGN(size, PAGE_SIZE);
114
	obj = i915_gem_alloc_object(dev, size);
115
	obj = i915_gem_alloc_object(dev, size);
Line 184... Line 185...
184
 
185
 
Line 185... Line 186...
185
	info->screen_size = size;
186
	info->screen_size = size;
Line 186... Line 187...
186
 
187
 
187
//	memset(info->screen_base, 0, size);
188
//	memset(info->screen_base, 0, size);
Line 188... Line 189...
188
 
189
 
189
	drm_fb_helper_fill_fix(info, fb->pitch, fb->depth);
190
	drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth);
190
	drm_fb_helper_fill_var(info, &ifbdev->helper, sizes->fb_width, sizes->fb_height);
191
	drm_fb_helper_fill_var(info, &ifbdev->helper, sizes->fb_width, sizes->fb_height);
Line 204... Line 205...
204
//   drm_gem_object_unreference(&obj->base);
205
//   drm_gem_object_unreference(&obj->base);
205
	mutex_unlock(&dev->struct_mutex);
206
	mutex_unlock(&dev->struct_mutex);
206
out:
207
out:
207
	return ret;
208
	return ret;
208
}
209
}
-
 
210
 
209
static int intel_fb_find_or_create_single(struct drm_fb_helper *helper,
211
static int intel_fb_find_or_create_single(struct drm_fb_helper *helper,
210
					  struct drm_fb_helper_surface_size *sizes)
212
					  struct drm_fb_helper_surface_size *sizes)
211
{
213
{
212
	struct intel_fbdev *ifbdev = (struct intel_fbdev *)helper;
214
	struct intel_fbdev *ifbdev = (struct intel_fbdev *)helper;
213
	int new_fb = 0;
215
	int new_fb = 0;