static int exynos_drm_connector_fill_modes(struct drm_connector *connector, unsigned int max_width, unsigned int max_height) { struct exynos_drm_connector *exynos_connector = to_exynos_connector(connector); struct exynos_drm_manager *manager = exynos_connector->manager; struct exynos_drm_manager_ops *ops = manager->ops; unsigned int width, height; width = max_width; height = max_height; /* * if specific driver want to find desired_mode using maxmum * resolution then get max width and height from that driver. */ if (ops && ops->get_max_resol) ops->get_max_resol(manager->dev, &width, &height); return drm_helper_probe_single_connector_modes(connector, width, height); }
static int ch7006_encoder_set_property(struct drm_encoder *encoder, struct drm_connector *connector, struct drm_property *property, uint64_t val) { struct i2c_client *client = drm_i2c_encoder_get_client(encoder); struct ch7006_priv *priv = to_ch7006_priv(encoder); struct ch7006_state *state = &priv->state; struct drm_mode_config *conf = &encoder->dev->mode_config; struct drm_crtc *crtc = encoder->crtc; bool modes_changed = false; ch7006_dbg(client, "\n"); if (property == conf->tv_select_subconnector_property) { priv->select_subconnector = val; ch7006_setup_power_state(encoder); ch7006_load_reg(client, state, CH7006_POWER); } else if (property == conf->tv_left_margin_property) { priv->hmargin = val; ch7006_setup_properties(encoder); ch7006_load_reg(client, state, CH7006_POV); ch7006_load_reg(client, state, CH7006_HPOS); } else if (property == conf->tv_bottom_margin_property) { priv->vmargin = val; ch7006_setup_properties(encoder); ch7006_load_reg(client, state, CH7006_POV); ch7006_load_reg(client, state, CH7006_VPOS); } else if (property == conf->tv_mode_property) { if (connector->dpms != DRM_MODE_DPMS_OFF) return -EINVAL; priv->norm = val; modes_changed = true; } else if (property == conf->tv_brightness_property) { priv->brightness = val; ch7006_setup_levels(encoder); ch7006_load_reg(client, state, CH7006_BLACK_LEVEL); } else if (property == conf->tv_contrast_property) { priv->contrast = val; ch7006_setup_properties(encoder); ch7006_load_reg(client, state, CH7006_CONTRAST); } else if (property == conf->tv_flicker_reduction_property) { priv->flicker = val; ch7006_setup_properties(encoder); ch7006_load_reg(client, state, CH7006_FFILTER); } else if (property == priv->scale_property) { if (connector->dpms != DRM_MODE_DPMS_OFF) return -EINVAL; priv->scale = val; modes_changed = true; } else { return -EINVAL; } if (modes_changed) { drm_helper_probe_single_connector_modes(connector, 0, 0); /* Disable the crtc to ensure a full modeset is * performed whenever it's turned on again. */ if (crtc) { struct drm_mode_set modeset = { .crtc = crtc, }; crtc->funcs->set_config(&modeset); } } return 0; }