aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_modes.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2012-03-27 10:32:29 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-03-27 10:32:29 -0400
commit50953e0640b3473dcb409d5d0d938c2742c93b0d (patch)
tree3b0dc374e61564fbbd8adff92c8fae16fdeb423a /drivers/gpu/drm/drm_modes.c
parentf92c97c8bd77992ff8bd6ef29a23dc82dca799cb (diff)
parent626cf236608505d376e4799adb4f7eb00a8594af (diff)
Merge branch 'poll' into staging/for_v3.4
* poll: (5970 commits) poll: add poll_requested_events() and poll_does_not_wait() functions crc32: select an algorithm via Kconfig crc32: add self-test code for crc32c crypto: crc32c should use library implementation crc32: bolt on crc32c crc32: add note about this patchset to crc32.c crc32: optimize loop counter for x86 crc32: add slice-by-8 algorithm to existing code crc32: make CRC_*_BITS definition correspond to actual bit counts crc32: fix mixing of endian-specific types crc32: miscellaneous cleanups crc32: simplify unit test code crc32: move long comment about crc32 fundamentals to Documentation/ crc32: remove two instances of trailing whitespaces checkpatch: check for quoted strings broken across lines checkpatch: whitespace - add/remove blank lines checkpatch: warn on use of yield() checkpatch: add --strict tests for braces, comments and casts checkpatch: add [] to type extensions checkpatch: high precedence operators do not require additional parentheses in #defines ...
Diffstat (limited to 'drivers/gpu/drm/drm_modes.c')
-rw-r--r--drivers/gpu/drm/drm_modes.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index fb8e46b4e8bc..b7adb4a967fd 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -686,8 +686,6 @@ void drm_mode_set_crtcinfo(struct drm_display_mode *p, int adjust_flags)
686 p->crtc_vsync_end /= 2; 686 p->crtc_vsync_end /= 2;
687 p->crtc_vtotal /= 2; 687 p->crtc_vtotal /= 2;
688 } 688 }
689
690 p->crtc_vtotal |= 1;
691 } 689 }
692 690
693 if (p->flags & DRM_MODE_FLAG_DBLSCAN) { 691 if (p->flags & DRM_MODE_FLAG_DBLSCAN) {
@@ -716,6 +714,27 @@ EXPORT_SYMBOL(drm_mode_set_crtcinfo);
716 714
717 715
718/** 716/**
717 * drm_mode_copy - copy the mode
718 * @dst: mode to overwrite
719 * @src: mode to copy
720 *
721 * LOCKING:
722 * None.
723 *
724 * Copy an existing mode into another mode, preserving the object id
725 * of the destination mode.
726 */
727void drm_mode_copy(struct drm_display_mode *dst, const struct drm_display_mode *src)
728{
729 int id = dst->base.id;
730
731 *dst = *src;
732 dst->base.id = id;
733 INIT_LIST_HEAD(&dst->head);
734}
735EXPORT_SYMBOL(drm_mode_copy);
736
737/**
719 * drm_mode_duplicate - allocate and duplicate an existing mode 738 * drm_mode_duplicate - allocate and duplicate an existing mode
720 * @m: mode to duplicate 739 * @m: mode to duplicate
721 * 740 *
@@ -729,16 +748,13 @@ struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev,
729 const struct drm_display_mode *mode) 748 const struct drm_display_mode *mode)
730{ 749{
731 struct drm_display_mode *nmode; 750 struct drm_display_mode *nmode;
732 int new_id;
733 751
734 nmode = drm_mode_create(dev); 752 nmode = drm_mode_create(dev);
735 if (!nmode) 753 if (!nmode)
736 return NULL; 754 return NULL;
737 755
738 new_id = nmode->base.id; 756 drm_mode_copy(nmode, mode);
739 *nmode = *mode; 757
740 nmode->base.id = new_id;
741 INIT_LIST_HEAD(&nmode->head);
742 return nmode; 758 return nmode;
743} 759}
744EXPORT_SYMBOL(drm_mode_duplicate); 760EXPORT_SYMBOL(drm_mode_duplicate);