Subversion Repositories Kolibri OS

Rev

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

Rev 3263 Rev 3480
Line 89... Line 89...
89
//   .fb_setcmap = drm_fb_helper_setcmap,
89
//   .fb_setcmap = drm_fb_helper_setcmap,
90
//   .fb_debug_enter = drm_fb_helper_debug_enter,
90
//   .fb_debug_enter = drm_fb_helper_debug_enter,
91
//   .fb_debug_leave = drm_fb_helper_debug_leave,
91
//   .fb_debug_leave = drm_fb_helper_debug_leave,
92
};
92
};
Line 93... Line 93...
93
 
93
 
94
static int intelfb_create(struct intel_fbdev *ifbdev,
94
static int intelfb_create(struct drm_fb_helper *helper,
95
			  struct drm_fb_helper_surface_size *sizes)
95
			  struct drm_fb_helper_surface_size *sizes)
-
 
96
{
96
{
97
	struct intel_fbdev *ifbdev = (struct intel_fbdev *)helper;
97
	struct drm_device *dev = ifbdev->helper.dev;
98
	struct drm_device *dev = ifbdev->helper.dev;
98
	struct drm_i915_private *dev_priv = dev->dev_private;
99
	struct drm_i915_private *dev_priv = dev->dev_private;
99
	struct fb_info *info;
100
	struct fb_info *info;
100
	struct drm_framebuffer *fb;
101
	struct drm_framebuffer *fb;
Line 184... Line 185...
184
	if (!info->apertures) {
185
	if (!info->apertures) {
185
		ret = -ENOMEM;
186
		ret = -ENOMEM;
186
		goto out_unpin;
187
		goto out_unpin;
187
	}
188
	}
188
	info->apertures->ranges[0].base = dev->mode_config.fb_base;
189
	info->apertures->ranges[0].base = dev->mode_config.fb_base;
189
	info->apertures->ranges[0].size =
190
	info->apertures->ranges[0].size = dev_priv->gtt.mappable_end;
190
		dev_priv->mm.gtt->gtt_mappable_entries << PAGE_SHIFT;
-
 
Line 191... Line 191...
191
 
191
 
192
	info->fix.smem_start = dev->mode_config.fb_base + obj->gtt_offset;
192
	info->fix.smem_start = dev->mode_config.fb_base + obj->gtt_offset;
Line 193... Line 193...
193
	info->fix.smem_len = size;
193
	info->fix.smem_len = size;
Line 221... Line 221...
221
	mutex_unlock(&dev->struct_mutex);
221
	mutex_unlock(&dev->struct_mutex);
222
out:
222
out:
223
	return ret;
223
	return ret;
224
}
224
}
Line 225... Line -...
225
 
-
 
226
static int intel_fb_find_or_create_single(struct drm_fb_helper *helper,
-
 
227
					  struct drm_fb_helper_surface_size *sizes)
-
 
228
{
-
 
229
	struct intel_fbdev *ifbdev = (struct intel_fbdev *)helper;
-
 
230
	int new_fb = 0;
-
 
231
	int ret;
-
 
232
 
-
 
233
	if (!helper->fb) {
-
 
234
		ret = intelfb_create(ifbdev, sizes);
-
 
235
		if (ret)
-
 
236
			return ret;
-
 
237
		new_fb = 1;
-
 
238
	}
-
 
239
	return new_fb;
-
 
240
}
-
 
241
 
225
 
242
static struct drm_fb_helper_funcs intel_fb_helper_funcs = {
226
static struct drm_fb_helper_funcs intel_fb_helper_funcs = {
243
	.gamma_set = intel_crtc_fb_gamma_set,
227
	.gamma_set = intel_crtc_fb_gamma_set,
244
	.gamma_get = intel_crtc_fb_gamma_get,
228
	.gamma_get = intel_crtc_fb_gamma_get,
245
    .fb_probe = intel_fb_find_or_create_single,
229
	.fb_probe = intelfb_create,
Line 246... Line 230...
246
};
230
};
247
 
231
 
Line 266... Line 250...
266
		kfree(ifbdev);
250
		kfree(ifbdev);
267
		return ret;
251
		return ret;
268
	}
252
	}
Line 269... Line 253...
269
 
253
 
270
	drm_fb_helper_single_add_all_connectors(&ifbdev->helper);
-
 
Line 271... Line 254...
271
	drm_fb_helper_initial_config(&ifbdev->helper, 32);
254
	drm_fb_helper_single_add_all_connectors(&ifbdev->helper);
272
 
255
 
Line -... Line 256...
-
 
256
    return 0;
-
 
257
}
-
 
258
 
Line -... Line 259...
-
 
259
void intel_fbdev_initial_config(struct drm_device *dev)
-
 
260
{
-
 
261
	drm_i915_private_t *dev_priv = dev->dev_private;
-
 
262
 
-
 
263
	/* Due to peculiar init order wrt to hpd handling this is separate. */
-
 
264
	drm_fb_helper_initial_config(&dev_priv->fbdev->helper, 32);
-
 
265
}
-
 
266
 
-
 
267
void intel_fb_output_poll_changed(struct drm_device *dev)