aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2012-03-13 06:35:51 -0400
committerDave Airlie <airlied@redhat.com>2012-03-15 05:52:51 -0400
commitc3c50e8b651887bcefcc13beb3739c00b2379b5c (patch)
tree087ae3ec7c437125bee9a40d50a2de79685348ed /drivers/gpu/drm/nouveau
parentd63f5e6bf6f2a1573ea39c9937cdf5ab0b3a4b77 (diff)
drm: Add drm_mode_copy()
Add a helper function to copy a display mode. Use it in drm_mode_duplicate() and nouveau mode_fixup hooks. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r--drivers/gpu/drm/nouveau/nv50_dac.c7
-rw-r--r--drivers/gpu/drm/nouveau/nv50_sor.c7
2 files changed, 4 insertions, 10 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_dac.c b/drivers/gpu/drm/nouveau/nv50_dac.c
index a0f2bebf49e3..55c56330be6d 100644
--- a/drivers/gpu/drm/nouveau/nv50_dac.c
+++ b/drivers/gpu/drm/nouveau/nv50_dac.c
@@ -190,11 +190,8 @@ nv50_dac_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode,
190 } 190 }
191 191
192 if (connector->scaling_mode != DRM_MODE_SCALE_NONE && 192 if (connector->scaling_mode != DRM_MODE_SCALE_NONE &&
193 connector->native_mode) { 193 connector->native_mode)
194 int id = adjusted_mode->base.id; 194 drm_mode_copy(adjusted_mode, connector->native_mode);
195 *adjusted_mode = *connector->native_mode;
196 adjusted_mode->base.id = id;
197 }
198 195
199 return true; 196 return true;
200} 197}
diff --git a/drivers/gpu/drm/nouveau/nv50_sor.c b/drivers/gpu/drm/nouveau/nv50_sor.c
index 9a5c2c98658c..a7844ab6a50c 100644
--- a/drivers/gpu/drm/nouveau/nv50_sor.c
+++ b/drivers/gpu/drm/nouveau/nv50_sor.c
@@ -342,11 +342,8 @@ nv50_sor_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode,
342 } 342 }
343 343
344 if (connector->scaling_mode != DRM_MODE_SCALE_NONE && 344 if (connector->scaling_mode != DRM_MODE_SCALE_NONE &&
345 connector->native_mode) { 345 connector->native_mode)
346 int id = adjusted_mode->base.id; 346 drm_mode_copy(adjusted_mode, connector->native_mode);
347 *adjusted_mode = *connector->native_mode;
348 adjusted_mode->base.id = id;
349 }
350 347
351 return true; 348 return true;
352} 349}