705,12 → 705,18 |
/** |
* drm_mode_set_crtcinfo - set CRTC modesetting parameters |
* @p: mode |
* @adjust_flags: unused? (FIXME) |
* @adjust_flags: a combination of adjustment flags |
* |
* LOCKING: |
* None. |
* |
* Setup the CRTC modesetting parameters for @p, adjusting if necessary. |
* |
* - The CRTC_INTERLACE_HALVE_V flag can be used to halve vertical timings of |
* interlaced modes. |
* - The CRTC_STEREO_DOUBLE flag can be used to compute the timings for |
* buffers containing two eyes (only adjust the timings when needed, eg. for |
* "frame packing" or "side by side full"). |
*/ |
void drm_mode_set_crtcinfo(struct drm_display_mode *p, int adjust_flags) |
{ |
717,6 → 723,7 |
if ((p == NULL) || ((p->type & DRM_MODE_TYPE_CRTC_C) == DRM_MODE_TYPE_BUILTIN)) |
return; |
|
p->crtc_clock = p->clock; |
p->crtc_hdisplay = p->hdisplay; |
p->crtc_hsync_start = p->hsync_start; |
p->crtc_hsync_end = p->hsync_end; |
750,6 → 757,20 |
p->crtc_vtotal *= p->vscan; |
} |
|
if (adjust_flags & CRTC_STEREO_DOUBLE) { |
unsigned int layout = p->flags & DRM_MODE_FLAG_3D_MASK; |
|
switch (layout) { |
case DRM_MODE_FLAG_3D_FRAME_PACKING: |
p->crtc_clock *= 2; |
p->crtc_vdisplay += p->crtc_vtotal; |
p->crtc_vsync_start += p->crtc_vtotal; |
p->crtc_vsync_end += p->crtc_vtotal; |
p->crtc_vtotal += p->crtc_vtotal; |
break; |
} |
} |
|
p->crtc_vblank_start = min(p->crtc_vsync_start, p->crtc_vdisplay); |
p->crtc_vblank_end = max(p->crtc_vsync_end, p->crtc_vtotal); |
p->crtc_hblank_start = min(p->crtc_hsync_start, p->crtc_hdisplay); |
828,12 → 849,16 |
} else if (mode1->clock != mode2->clock) |
return false; |
|
return drm_mode_equal_no_clocks(mode1, mode2); |
if ((mode1->flags & DRM_MODE_FLAG_3D_MASK) != |
(mode2->flags & DRM_MODE_FLAG_3D_MASK)) |
return false; |
|
return drm_mode_equal_no_clocks_no_stereo(mode1, mode2); |
} |
EXPORT_SYMBOL(drm_mode_equal); |
|
/** |
* drm_mode_equal_no_clocks - test modes for equality |
* drm_mode_equal_no_clocks_no_stereo - test modes for equality |
* @mode1: first mode |
* @mode2: second mode |
* |
841,12 → 866,13 |
* None. |
* |
* Check to see if @mode1 and @mode2 are equivalent, but |
* don't check the pixel clocks. |
* don't check the pixel clocks nor the stereo layout. |
* |
* RETURNS: |
* True if the modes are equal, false otherwise. |
*/ |
bool drm_mode_equal_no_clocks(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2) |
bool drm_mode_equal_no_clocks_no_stereo(const struct drm_display_mode *mode1, |
const struct drm_display_mode *mode2) |
{ |
if (mode1->hdisplay == mode2->hdisplay && |
mode1->hsync_start == mode2->hsync_start && |
858,12 → 884,13 |
mode1->vsync_end == mode2->vsync_end && |
mode1->vtotal == mode2->vtotal && |
mode1->vscan == mode2->vscan && |
mode1->flags == mode2->flags) |
(mode1->flags & ~DRM_MODE_FLAG_3D_MASK) == |
(mode2->flags & ~DRM_MODE_FLAG_3D_MASK)) |
return true; |
|
return false; |
} |
EXPORT_SYMBOL(drm_mode_equal_no_clocks); |
EXPORT_SYMBOL(drm_mode_equal_no_clocks_no_stereo); |
|
/** |
* drm_mode_validate_size - make sure modes adhere to size constraints |