提交 fb06ca8f 编写于 作者: A Alex Deucher 提交者: Dave Airlie

drm/radeon/kms: properly handle mode id with native mode changes

drm modes are objects with indentifiers.  Make sure to preserve
the mode id when copying mode params.
Signed-off-by: NAlex Deucher <alexdeucher@gmail.com>
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 39deb2d6
...@@ -183,8 +183,7 @@ static struct drm_display_mode *radeon_fp_native_mode(struct drm_encoder *encode ...@@ -183,8 +183,7 @@ static struct drm_display_mode *radeon_fp_native_mode(struct drm_encoder *encode
if (native_mode->hdisplay != 0 && if (native_mode->hdisplay != 0 &&
native_mode->vdisplay != 0 && native_mode->vdisplay != 0 &&
native_mode->clock != 0) { native_mode->clock != 0) {
mode = drm_mode_create(dev); mode = drm_mode_duplicate(dev, native_mode);
*mode = *native_mode;
mode->type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER; mode->type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER;
drm_mode_set_name(mode); drm_mode_set_name(mode);
......
...@@ -175,11 +175,13 @@ void radeon_rmx_mode_fixup(struct drm_encoder *encoder, ...@@ -175,11 +175,13 @@ void radeon_rmx_mode_fixup(struct drm_encoder *encoder,
if (mode->hdisplay < native_mode->hdisplay || if (mode->hdisplay < native_mode->hdisplay ||
mode->vdisplay < native_mode->vdisplay) { mode->vdisplay < native_mode->vdisplay) {
int mode_id = adjusted_mode->base.id;
*adjusted_mode = *native_mode; *adjusted_mode = *native_mode;
if (!ASIC_IS_AVIVO(rdev)) { if (!ASIC_IS_AVIVO(rdev)) {
adjusted_mode->hdisplay = mode->hdisplay; adjusted_mode->hdisplay = mode->hdisplay;
adjusted_mode->vdisplay = mode->vdisplay; adjusted_mode->vdisplay = mode->vdisplay;
} }
adjusted_mode->base.id = mode_id;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册