Subversion Repositories Kolibri OS

Rev

Rev 6937 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6937 Rev 7144
Line 71... Line 71...
71
 * These legacy modeset helpers use the same function table structures as
71
 * These legacy modeset helpers use the same function table structures as
72
 * all other modesetting helpers. See the documentation for struct
72
 * all other modesetting helpers. See the documentation for struct
73
 * &drm_crtc_helper_funcs, struct &drm_encoder_helper_funcs and struct
73
 * &drm_crtc_helper_funcs, struct &drm_encoder_helper_funcs and struct
74
 * &drm_connector_helper_funcs.
74
 * &drm_connector_helper_funcs.
75
 */
75
 */
76
MODULE_AUTHOR("David Airlie, Jesse Barnes");
-
 
77
MODULE_DESCRIPTION("DRM KMS helper");
-
 
78
MODULE_LICENSE("GPL and additional rights");
-
 
Line 79... Line 76...
79
 
76
 
80
/**
77
/**
81
 * drm_helper_move_panel_connectors_to_head() - move panels to the front in the
78
 * drm_helper_move_panel_connectors_to_head() - move panels to the front in the
82
 * 						connector list
79
 * 						connector list
Line 218... Line 215...
218
 * This function walks through the entire mode setting configuration of @dev. It
215
 * This function walks through the entire mode setting configuration of @dev. It
219
 * will remove any CRTC links of unused encoders and encoder links of
216
 * will remove any CRTC links of unused encoders and encoder links of
220
 * disconnected connectors. Then it will disable all unused encoders and CRTCs
217
 * disconnected connectors. Then it will disable all unused encoders and CRTCs
221
 * either by calling their disable callback if available or by calling their
218
 * either by calling their disable callback if available or by calling their
222
 * dpms callback with DRM_MODE_DPMS_OFF.
219
 * dpms callback with DRM_MODE_DPMS_OFF.
-
 
220
 *
-
 
221
 * NOTE:
-
 
222
 *
-
 
223
 * This function is part of the legacy modeset helper library and will cause
-
 
224
 * major confusion with atomic drivers. This is because atomic helpers guarantee
-
 
225
 * to never call ->disable() hooks on a disabled function, or ->enable() hooks
-
 
226
 * on an enabled functions. drm_helper_disable_unused_functions() on the other
-
 
227
 * hand throws such guarantees into the wind and calls disable hooks
-
 
228
 * unconditionally on unused functions.
223
 */
229
 */
224
void drm_helper_disable_unused_functions(struct drm_device *dev)
230
void drm_helper_disable_unused_functions(struct drm_device *dev)
225
{
231
{
226
	drm_modeset_lock_all(dev);
232
	drm_modeset_lock_all(dev);
227
	__drm_helper_disable_unused_functions(dev);
233
	__drm_helper_disable_unused_functions(dev);
Line 326... Line 332...
326
			DRM_DEBUG_KMS("Bridge fixup failed\n");
332
			DRM_DEBUG_KMS("Bridge fixup failed\n");
327
			goto done;
333
			goto done;
328
		}
334
		}
Line 329... Line 335...
329
 
335
 
-
 
336
		encoder_funcs = encoder->helper_private;
330
		encoder_funcs = encoder->helper_private;
337
		if (encoder_funcs->mode_fixup) {
331
		if (!(ret = encoder_funcs->mode_fixup(encoder, mode,
338
			if (!(ret = encoder_funcs->mode_fixup(encoder, mode,
332
						      adjusted_mode))) {
339
							      adjusted_mode))) {
333
			DRM_DEBUG_KMS("Encoder fixup failed\n");
340
				DRM_DEBUG_KMS("Encoder fixup failed\n");
334
			goto done;
341
				goto done;
335
		}
342
			}
-
 
343
		}
Line -... Line 344...
-
 
344
	}
336
	}
345
 
-
 
346
	if (crtc_funcs->mode_fixup) {
337
 
347
		if (!(ret = crtc_funcs->mode_fixup(crtc, mode,
338
	if (!(ret = crtc_funcs->mode_fixup(crtc, mode, adjusted_mode))) {
348
						adjusted_mode))) {
339
		DRM_DEBUG_KMS("CRTC fixup failed\n");
349
			DRM_DEBUG_KMS("CRTC fixup failed\n");
-
 
350
			goto done;
340
		goto done;
351
		}
Line 341... Line 352...
341
	}
352
	}
Line 342... Line 353...
342
	DRM_DEBUG_KMS("[CRTC:%d:%s]\n", crtc->base.id, crtc->name);
353
	DRM_DEBUG_KMS("[CRTC:%d:%s]\n", crtc->base.id, crtc->name);
Line 576... Line 587...
576
	if (set->crtc->primary->fb != set->fb) {
587
	if (set->crtc->primary->fb != set->fb) {
577
		/* If we have no fb then treat it as a full mode set */
588
		/* If we have no fb then treat it as a full mode set */
578
		if (set->crtc->primary->fb == NULL) {
589
		if (set->crtc->primary->fb == NULL) {
579
			DRM_DEBUG_KMS("crtc has no fb, full mode set\n");
590
			DRM_DEBUG_KMS("crtc has no fb, full mode set\n");
580
			mode_changed = true;
591
			mode_changed = true;
581
		} else if (set->fb == NULL) {
-
 
582
			mode_changed = true;
-
 
583
		} else if (set->fb->pixel_format !=
592
		} else if (set->fb->pixel_format !=
584
			   set->crtc->primary->fb->pixel_format) {
593
			   set->crtc->primary->fb->pixel_format) {
585
			mode_changed = true;
594
			mode_changed = true;
586
		} else
595
		} else
587
			fb_changed = true;
596
			fb_changed = true;
588
	}
597
	}
Line 589... Line 598...
589
 
598
 
590
	if (set->x != set->crtc->x || set->y != set->crtc->y)
599
	if (set->x != set->crtc->x || set->y != set->crtc->y)
Line 591... Line 600...
591
		fb_changed = true;
600
		fb_changed = true;
592
 
601
 
593
	if (set->mode && !drm_mode_equal(set->mode, &set->crtc->mode)) {
602
	if (!drm_mode_equal(set->mode, &set->crtc->mode)) {
594
		DRM_DEBUG_KMS("modes are different, full mode set\n");
603
		DRM_DEBUG_KMS("modes are different, full mode set\n");
595
		drm_mode_debug_printmodeline(&set->crtc->mode);
604
		drm_mode_debug_printmodeline(&set->crtc->mode);
596
		drm_mode_debug_printmodeline(set->mode);
605
		drm_mode_debug_printmodeline(set->mode);
Line 1064... Line 1073...
1064
	plane_state->src_w = crtc->mode.hdisplay << 16;
1073
	plane_state->src_w = crtc->mode.hdisplay << 16;
Line 1065... Line 1074...
1065
 
1074
 
1066
	return drm_plane_helper_commit(plane, plane_state, old_fb);
1075
	return drm_plane_helper_commit(plane, plane_state, old_fb);
1067
}
1076
}
-
 
1077
EXPORT_SYMBOL(drm_helper_crtc_mode_set_base);
-
 
1078
 
-
 
1079
/**
-
 
1080
 * drm_helper_crtc_enable_color_mgmt - enable color management properties
-
 
1081
 * @crtc: DRM CRTC
-
 
1082
 * @degamma_lut_size: the size of the degamma lut (before CSC)
-
 
1083
 * @gamma_lut_size: the size of the gamma lut (after CSC)
-
 
1084
 *
-
 
1085
 * This function lets the driver enable the color correction properties on a
-
 
1086
 * CRTC. This includes 3 degamma, csc and gamma properties that userspace can
-
 
1087
 * set and 2 size properties to inform the userspace of the lut sizes.
-
 
1088
 */
-
 
1089
void drm_helper_crtc_enable_color_mgmt(struct drm_crtc *crtc,
-
 
1090
				       int degamma_lut_size,
-
 
1091
				       int gamma_lut_size)
-
 
1092
{
-
 
1093
	struct drm_device *dev = crtc->dev;
-
 
1094
	struct drm_mode_config *config = &dev->mode_config;
-
 
1095
 
-
 
1096
	drm_object_attach_property(&crtc->base,
-
 
1097
				   config->degamma_lut_property, 0);
-
 
1098
	drm_object_attach_property(&crtc->base,
-
 
1099
				   config->ctm_property, 0);
-
 
1100
	drm_object_attach_property(&crtc->base,
-
 
1101
				   config->gamma_lut_property, 0);
-
 
1102
 
-
 
1103
	drm_object_attach_property(&crtc->base,
-
 
1104
				   config->degamma_lut_size_property,
-
 
1105
				   degamma_lut_size);
-
 
1106
	drm_object_attach_property(&crtc->base,
-
 
1107
				   config->gamma_lut_size_property,
-
 
1108
				   gamma_lut_size);
-
 
1109
}