diff options
-rw-r--r-- | drivers/gpu/drm/mgag200/mgag200_mode.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/mgag200/mgag200_vga_bmc.c | 18 |
2 files changed, 18 insertions, 3 deletions
diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c index dd125ef15559..8dc16821e1cd 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c @@ -611,7 +611,6 @@ int mgag200_crtc_helper_atomic_check(struct drm_crtc *crtc, struct drm_atomic_st struct mga_device *mdev = to_mga_device(dev); const struct mgag200_device_funcs *funcs = mdev->funcs; struct drm_crtc_state *new_crtc_state = drm_atomic_get_new_crtc_state(new_state, crtc); - struct mgag200_crtc_state *new_mgag200_crtc_state = to_mgag200_crtc_state(new_crtc_state); struct drm_property_blob *new_gamma_lut = new_crtc_state->gamma_lut; int ret; @@ -622,8 +621,6 @@ int mgag200_crtc_helper_atomic_check(struct drm_crtc *crtc, struct drm_atomic_st if (ret) return ret; - new_mgag200_crtc_state->set_vidrst = mdev->info->sync_bmc; - if (new_crtc_state->mode_changed) { if (funcs->pixpllc_atomic_check) { ret = funcs->pixpllc_atomic_check(crtc, new_state); diff --git a/drivers/gpu/drm/mgag200/mgag200_vga_bmc.c b/drivers/gpu/drm/mgag200/mgag200_vga_bmc.c index 3a958c3587ac..77340f2dee17 100644 --- a/drivers/gpu/drm/mgag200/mgag200_vga_bmc.c +++ b/drivers/gpu/drm/mgag200/mgag200_vga_bmc.c @@ -8,6 +8,22 @@ #include "mgag200_ddc.h" #include "mgag200_drv.h" +static int mgag200_vga_bmc_encoder_atomic_check(struct drm_encoder *encoder, + struct drm_crtc_state *new_crtc_state, + struct drm_connector_state *new_connector_state) +{ + struct mga_device *mdev = to_mga_device(encoder->dev); + struct mgag200_crtc_state *new_mgag200_crtc_state = to_mgag200_crtc_state(new_crtc_state); + + new_mgag200_crtc_state->set_vidrst = mdev->info->sync_bmc; + + return 0; +} + +static const struct drm_encoder_helper_funcs mgag200_dac_encoder_helper_funcs = { + .atomic_check = mgag200_vga_bmc_encoder_atomic_check, +}; + static const struct drm_encoder_funcs mgag200_dac_encoder_funcs = { .destroy = drm_encoder_cleanup }; @@ -86,6 +102,8 @@ int mgag200_vga_bmc_output_init(struct mga_device *mdev) drm_err(dev, "drm_encoder_init() failed: %d\n", ret); return ret; } + drm_encoder_helper_add(encoder, &mgag200_dac_encoder_helper_funcs); + encoder->possible_crtcs = drm_crtc_mask(crtc); ddc = mgag200_ddc_create(mdev); |