Merge tag 'topic/drm-misc-2015-07-28' of git://anongit.freedesktop.org/drm-intel into drm-next

More drm-misc, mostly fine-tuning of atomic helpers. They're mostly
driver-wide interface changes of the helpers and I need them for i915
work, so I plan to pull this tag into drm-intel-next too.

* tag 'topic/drm-misc-2015-07-28' of git://anongit.freedesktop.org/drm-intel:
  drm/atomic: Update legacy DPMS state during modesets, v3.
  drm: Make the connector dpms callback return a value, v2.
  drm/atomic: pass old crtc state to atomic_begin/flush.
  drm/atomic: add connectors_changed to separate it from mode_changed, v2
  drm: Fix DP_TEST_COUNT_MASK
This commit is contained in:
Dave Airlie 2015-07-30 12:45:11 +10:00
commit e5dafc0da0
29 changed files with 169 additions and 99 deletions

View File

@ -239,7 +239,8 @@ static int atmel_hlcdc_crtc_atomic_check(struct drm_crtc *c,
return atmel_hlcdc_plane_prepare_disc_area(s);
}
static void atmel_hlcdc_crtc_atomic_begin(struct drm_crtc *c)
static void atmel_hlcdc_crtc_atomic_begin(struct drm_crtc *c,
struct drm_crtc_state *old_s)
{
struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c);
@ -253,7 +254,8 @@ static void atmel_hlcdc_crtc_atomic_begin(struct drm_crtc *c)
}
}
static void atmel_hlcdc_crtc_atomic_flush(struct drm_crtc *crtc)
static void atmel_hlcdc_crtc_atomic_flush(struct drm_crtc *crtc,
struct drm_crtc_state *old_s)
{
/* TODO: write common plane control register if available */
}

View File

@ -124,7 +124,7 @@ steal_encoder(struct drm_atomic_state *state,
if (IS_ERR(crtc_state))
return PTR_ERR(crtc_state);
crtc_state->mode_changed = true;
crtc_state->connectors_changed = true;
list_for_each_entry(connector, &config->connector_list, head) {
if (connector->state->best_encoder != encoder)
@ -174,14 +174,14 @@ update_connector_routing(struct drm_atomic_state *state, int conn_idx)
idx = drm_crtc_index(connector->state->crtc);
crtc_state = state->crtc_states[idx];
crtc_state->mode_changed = true;
crtc_state->connectors_changed = true;
}
if (connector_state->crtc) {
idx = drm_crtc_index(connector_state->crtc);
crtc_state = state->crtc_states[idx];
crtc_state->mode_changed = true;
crtc_state->connectors_changed = true;
}
}
@ -233,7 +233,7 @@ update_connector_routing(struct drm_atomic_state *state, int conn_idx)
idx = drm_crtc_index(connector_state->crtc);
crtc_state = state->crtc_states[idx];
crtc_state->mode_changed = true;
crtc_state->connectors_changed = true;
DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] using [ENCODER:%d:%s] on [CRTC:%d]\n",
connector->base.id,
@ -256,7 +256,8 @@ mode_fixup(struct drm_atomic_state *state)
bool ret;
for_each_crtc_in_state(state, crtc, crtc_state, i) {
if (!crtc_state->mode_changed)
if (!crtc_state->mode_changed &&
!crtc_state->connectors_changed)
continue;
drm_mode_copy(&crtc_state->adjusted_mode, &crtc_state->mode);
@ -312,7 +313,8 @@ mode_fixup(struct drm_atomic_state *state)
for_each_crtc_in_state(state, crtc, crtc_state, i) {
const struct drm_crtc_helper_funcs *funcs;
if (!crtc_state->mode_changed)
if (!crtc_state->mode_changed &&
!crtc_state->connectors_changed)
continue;
funcs = crtc->helper_private;
@ -338,9 +340,14 @@ mode_fixup(struct drm_atomic_state *state)
*
* Check the state object to see if the requested state is physically possible.
* This does all the crtc and connector related computations for an atomic
* update. It computes and updates crtc_state->mode_changed, adds any additional
* connectors needed for full modesets and calls down into ->mode_fixup
* functions of the driver backend.
* update and adds any additional connectors needed for full modesets and calls
* down into ->mode_fixup functions of the driver backend.
*
* crtc_state->mode_changed is set when the input mode is changed.
* crtc_state->connectors_changed is set when a connector is added or
* removed from the crtc.
* crtc_state->active_changed is set when crtc_state->active changes,
* which is used for dpms.
*
* IMPORTANT:
*
@ -373,7 +380,17 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
if (crtc->state->enable != crtc_state->enable) {
DRM_DEBUG_ATOMIC("[CRTC:%d] enable changed\n",
crtc->base.id);
/*
* For clarity this assignment is done here, but
* enable == 0 is only true when there are no
* connectors and a NULL mode.
*
* The other way around is true as well. enable != 0
* iff connectors are attached and a mode is set.
*/
crtc_state->mode_changed = true;
crtc_state->connectors_changed = true;
}
}
@ -448,6 +465,9 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset);
* This does all the plane update related checks using by calling into the
* ->atomic_check hooks provided by the driver.
*
* It also sets crtc_state->planes_changed to indicate that a crtc has
* updated planes.
*
* RETURNS
* Zero for success or -errno
*/
@ -640,15 +660,29 @@ drm_atomic_helper_update_legacy_modeset_state(struct drm_device *dev,
struct drm_crtc_state *old_crtc_state;
int i;
/* clear out existing links */
/* clear out existing links and update dpms */
for_each_connector_in_state(old_state, connector, old_conn_state, i) {
if (!connector->encoder)
continue;
if (connector->encoder) {
WARN_ON(!connector->encoder->crtc);
WARN_ON(!connector->encoder->crtc);
connector->encoder->crtc = NULL;
connector->encoder = NULL;
}
connector->encoder->crtc = NULL;
connector->encoder = NULL;
crtc = connector->state->crtc;
if ((!crtc && old_conn_state->crtc) ||
(crtc && drm_atomic_crtc_needs_modeset(crtc->state))) {
struct drm_property *dpms_prop =
dev->mode_config.dpms_property;
int mode = DRM_MODE_DPMS_OFF;
if (crtc && crtc->state->active)
mode = DRM_MODE_DPMS_ON;
connector->dpms = mode;
drm_object_property_set_value(&connector->base,
dpms_prop, mode);
}
}
/* set new links */
@ -1144,7 +1178,7 @@ void drm_atomic_helper_commit_planes(struct drm_device *dev,
if (!funcs || !funcs->atomic_begin)
continue;
funcs->atomic_begin(crtc);
funcs->atomic_begin(crtc, old_crtc_state);
}
for_each_plane_in_state(old_state, plane, old_plane_state, i) {
@ -1174,7 +1208,7 @@ void drm_atomic_helper_commit_planes(struct drm_device *dev,
if (!funcs || !funcs->atomic_flush)
continue;
funcs->atomic_flush(crtc);
funcs->atomic_flush(crtc, old_crtc_state);
}
}
EXPORT_SYMBOL(drm_atomic_helper_commit_planes);
@ -1210,7 +1244,7 @@ drm_atomic_helper_commit_planes_on_crtc(struct drm_crtc_state *old_crtc_state)
crtc_funcs = crtc->helper_private;
if (crtc_funcs && crtc_funcs->atomic_begin)
crtc_funcs->atomic_begin(crtc);
crtc_funcs->atomic_begin(crtc, old_crtc_state);
drm_for_each_plane_mask(plane, crtc->dev, plane_mask) {
struct drm_plane_state *old_plane_state =
@ -1233,7 +1267,7 @@ drm_atomic_helper_commit_planes_on_crtc(struct drm_crtc_state *old_crtc_state)
}
if (crtc_funcs && crtc_funcs->atomic_flush)
crtc_funcs->atomic_flush(crtc);
crtc_funcs->atomic_flush(crtc, old_crtc_state);
}
EXPORT_SYMBOL(drm_atomic_helper_commit_planes_on_crtc);
@ -1954,9 +1988,12 @@ EXPORT_SYMBOL(drm_atomic_helper_page_flip);
* implementing the legacy DPMS connector interface. It computes the new desired
* ->active state for the corresponding CRTC (if the connector is enabled) and
* updates it.
*
* Returns:
* Returns 0 on success, negative errno numbers on failure.
*/
void drm_atomic_helper_connector_dpms(struct drm_connector *connector,
int mode)
int drm_atomic_helper_connector_dpms(struct drm_connector *connector,
int mode)
{
struct drm_mode_config *config = &connector->dev->mode_config;
struct drm_atomic_state *state;
@ -1965,6 +2002,7 @@ void drm_atomic_helper_connector_dpms(struct drm_connector *connector,
struct drm_connector *tmp_connector;
int ret;
bool active = false;
int old_mode = connector->dpms;
if (mode != DRM_MODE_DPMS_ON)
mode = DRM_MODE_DPMS_OFF;
@ -1973,18 +2011,19 @@ void drm_atomic_helper_connector_dpms(struct drm_connector *connector,
crtc = connector->state->crtc;
if (!crtc)
return;
return 0;
/* FIXME: ->dpms has no return value so can't forward the -ENOMEM. */
state = drm_atomic_state_alloc(connector->dev);
if (!state)
return;
return -ENOMEM;
state->acquire_ctx = drm_modeset_legacy_acquire_ctx(crtc);
retry:
crtc_state = drm_atomic_get_crtc_state(state, crtc);
if (IS_ERR(crtc_state))
return;
if (IS_ERR(crtc_state)) {
ret = PTR_ERR(crtc_state);
goto fail;
}
WARN_ON(!drm_modeset_is_locked(&config->connection_mutex));
@ -2003,17 +2042,16 @@ void drm_atomic_helper_connector_dpms(struct drm_connector *connector,
if (ret != 0)
goto fail;
/* Driver takes ownership of state on successful async commit. */
return;
/* Driver takes ownership of state on successful commit. */
return 0;
fail:
if (ret == -EDEADLK)
goto backoff;
connector->dpms = old_mode;
drm_atomic_state_free(state);
WARN(1, "Driver bug: Changing ->active failed with ret=%i\n", ret);
return;
return ret;
backoff:
drm_atomic_state_clear(state);
drm_atomic_legacy_backoff(state);
@ -2074,6 +2112,7 @@ void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc,
state->mode_changed = false;
state->active_changed = false;
state->planes_changed = false;
state->connectors_changed = false;
state->event = NULL;
}
EXPORT_SYMBOL(__drm_atomic_helper_crtc_duplicate_state);

View File

@ -4753,9 +4753,9 @@ static int drm_mode_connector_set_obj_prop(struct drm_mode_object *obj,
/* Do DPMS ourselves */
if (property == connector->dev->mode_config.dpms_property) {
if (connector->funcs->dpms)
(*connector->funcs->dpms)(connector, (int)value);
ret = 0;
if (connector->funcs->dpms)
ret = (*connector->funcs->dpms)(connector, (int)value);
} else if (connector->funcs->set_property)
ret = connector->funcs->set_property(connector, property, value);

View File

@ -762,15 +762,18 @@ static int drm_helper_choose_crtc_dpms(struct drm_crtc *crtc)
* implementing the DPMS connector attribute. It computes the new desired DPMS
* state for all encoders and crtcs in the output mesh and calls the ->dpms()
* callback provided by the driver appropriately.
*
* Returns:
* Always returns 0.
*/
void drm_helper_connector_dpms(struct drm_connector *connector, int mode)
int drm_helper_connector_dpms(struct drm_connector *connector, int mode)
{
struct drm_encoder *encoder = connector->encoder;
struct drm_crtc *crtc = encoder ? encoder->crtc : NULL;
int old_dpms, encoder_dpms = DRM_MODE_DPMS_OFF;
if (mode == connector->dpms)
return;
return 0;
old_dpms = connector->dpms;
connector->dpms = mode;
@ -802,7 +805,7 @@ void drm_helper_connector_dpms(struct drm_connector *connector, int mode)
}
}
return;
return 0;
}
EXPORT_SYMBOL(drm_helper_connector_dpms);

View File

@ -437,7 +437,7 @@ int drm_plane_helper_commit(struct drm_plane *plane,
for (i = 0; i < 2; i++) {
if (crtc_funcs[i] && crtc_funcs[i]->atomic_begin)
crtc_funcs[i]->atomic_begin(crtc[i]);
crtc_funcs[i]->atomic_begin(crtc[i], crtc[i]->state);
}
/*
@ -452,7 +452,7 @@ int drm_plane_helper_commit(struct drm_plane *plane,
for (i = 0; i < 2; i++) {
if (crtc_funcs[i] && crtc_funcs[i]->atomic_flush)
crtc_funcs[i]->atomic_flush(crtc[i]);
crtc_funcs[i]->atomic_flush(crtc[i], crtc[i]->state);
}
/*

View File

@ -80,7 +80,8 @@ exynos_drm_crtc_mode_set_nofb(struct drm_crtc *crtc)
exynos_crtc->ops->commit(exynos_crtc);
}
static void exynos_crtc_atomic_begin(struct drm_crtc *crtc)
static void exynos_crtc_atomic_begin(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state)
{
struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
@ -90,7 +91,8 @@ static void exynos_crtc_atomic_begin(struct drm_crtc *crtc)
}
}
static void exynos_crtc_atomic_flush(struct drm_crtc *crtc)
static void exynos_crtc_atomic_flush(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state)
{
}

View File

@ -237,7 +237,7 @@ static void intel_enable_crt(struct intel_encoder *encoder)
}
/* Special dpms function to support cloning between dvo/sdvo/crt. */
static void intel_crt_dpms(struct drm_connector *connector, int mode)
static int intel_crt_dpms(struct drm_connector *connector, int mode)
{
struct drm_device *dev = connector->dev;
struct intel_encoder *encoder = intel_attached_encoder(connector);
@ -249,7 +249,7 @@ static void intel_crt_dpms(struct drm_connector *connector, int mode)
mode = DRM_MODE_DPMS_OFF;
if (mode == connector->dpms)
return;
return 0;
old_dpms = connector->dpms;
connector->dpms = mode;
@ -258,7 +258,7 @@ static void intel_crt_dpms(struct drm_connector *connector, int mode)
crtc = encoder->base.crtc;
if (!crtc) {
encoder->connectors_active = false;
return;
return 0;
}
/* We need the pipe to run for anything but OFF. */
@ -281,6 +281,8 @@ static void intel_crt_dpms(struct drm_connector *connector, int mode)
}
intel_modeset_check_state(connector->dev);
return 0;
}
static enum drm_mode_status

View File

@ -102,8 +102,8 @@ static void vlv_prepare_pll(struct intel_crtc *crtc,
const struct intel_crtc_state *pipe_config);
static void chv_prepare_pll(struct intel_crtc *crtc,
const struct intel_crtc_state *pipe_config);
static void intel_begin_crtc_commit(struct drm_crtc *crtc);
static void intel_finish_crtc_commit(struct drm_crtc *crtc);
static void intel_begin_crtc_commit(struct drm_crtc *, struct drm_crtc_state *);
static void intel_finish_crtc_commit(struct drm_crtc *, struct drm_crtc_state *);
static void skl_init_scalers(struct drm_device *dev, struct intel_crtc *intel_crtc,
struct intel_crtc_state *crtc_state);
static int i9xx_get_refclk(const struct intel_crtc_state *crtc_state,
@ -413,7 +413,7 @@ static const intel_limit_t intel_limits_bxt = {
static bool
needs_modeset(struct drm_crtc_state *state)
{
return state->mode_changed || state->active_changed;
return drm_atomic_crtc_needs_modeset(state);
}
/**
@ -6429,14 +6429,14 @@ struct intel_connector *intel_connector_alloc(void)
/* Even simpler default implementation, if there's really no special case to
* consider. */
void intel_connector_dpms(struct drm_connector *connector, int mode)
int intel_connector_dpms(struct drm_connector *connector, int mode)
{
/* All the simple cases only support two dpms states. */
if (mode != DRM_MODE_DPMS_ON)
mode = DRM_MODE_DPMS_OFF;
if (mode == connector->dpms)
return;
return 0;
connector->dpms = mode;
@ -6445,6 +6445,8 @@ void intel_connector_dpms(struct drm_connector *connector, int mode)
intel_encoder_dpms(to_intel_encoder(connector->encoder), mode);
intel_modeset_check_state(connector->dev);
return 0;
}
/* Simple connector->get_hw_state implementation for encoders that support only
@ -12347,16 +12349,9 @@ intel_modeset_update_state(struct drm_atomic_state *state)
continue;
if (crtc->state->active) {
struct drm_property *dpms_property =
dev->mode_config.dpms_property;
connector->dpms = DRM_MODE_DPMS_ON;
drm_object_property_set_value(&connector->base, dpms_property, DRM_MODE_DPMS_ON);
intel_encoder = to_intel_encoder(connector->encoder);
intel_encoder->connectors_active = true;
} else
connector->dpms = DRM_MODE_DPMS_OFF;
}
}
}
@ -13628,7 +13623,8 @@ intel_disable_primary_plane(struct drm_plane *plane,
dev_priv->display.update_primary_plane(crtc, NULL, 0, 0);
}
static void intel_begin_crtc_commit(struct drm_crtc *crtc)
static void intel_begin_crtc_commit(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state)
{
struct drm_device *dev = crtc->dev;
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
@ -13644,7 +13640,8 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc)
skl_detach_scalers(intel_crtc);
}
static void intel_finish_crtc_commit(struct drm_crtc *crtc)
static void intel_finish_crtc_commit(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state)
{
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);

View File

@ -997,7 +997,7 @@ void intel_crtc_update_dpms(struct drm_crtc *crtc);
void intel_encoder_destroy(struct drm_encoder *encoder);
int intel_connector_init(struct intel_connector *);
struct intel_connector *intel_connector_alloc(void);
void intel_connector_dpms(struct drm_connector *, int mode);
int intel_connector_dpms(struct drm_connector *, int mode);
bool intel_connector_get_hw_state(struct intel_connector *connector);
void intel_modeset_check_state(struct drm_device *dev);
bool ibx_digital_port_connected(struct drm_i915_private *dev_priv,

View File

@ -197,7 +197,7 @@ static void intel_enable_dvo(struct intel_encoder *encoder)
}
/* Special dpms function to support cloning between dvo/sdvo/crt. */
static void intel_dvo_dpms(struct drm_connector *connector, int mode)
static int intel_dvo_dpms(struct drm_connector *connector, int mode)
{
struct intel_dvo *intel_dvo = intel_attached_dvo(connector);
struct drm_crtc *crtc;
@ -208,7 +208,7 @@ static void intel_dvo_dpms(struct drm_connector *connector, int mode)
mode = DRM_MODE_DPMS_OFF;
if (mode == connector->dpms)
return;
return 0;
connector->dpms = mode;
@ -216,7 +216,7 @@ static void intel_dvo_dpms(struct drm_connector *connector, int mode)
crtc = intel_dvo->base.base.crtc;
if (!crtc) {
intel_dvo->base.connectors_active = false;
return;
return 0;
}
/* We call connector dpms manually below in case pipe dpms doesn't
@ -238,6 +238,8 @@ static void intel_dvo_dpms(struct drm_connector *connector, int mode)
}
intel_modeset_check_state(connector->dev);
return 0;
}
static enum drm_mode_status

View File

@ -1509,7 +1509,7 @@ static void intel_enable_sdvo(struct intel_encoder *encoder)
}
/* Special dpms function to support cloning between dvo/sdvo/crt. */
static void intel_sdvo_dpms(struct drm_connector *connector, int mode)
static int intel_sdvo_dpms(struct drm_connector *connector, int mode)
{
struct drm_crtc *crtc;
struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector);
@ -1519,7 +1519,7 @@ static void intel_sdvo_dpms(struct drm_connector *connector, int mode)
mode = DRM_MODE_DPMS_OFF;
if (mode == connector->dpms)
return;
return 0;
connector->dpms = mode;
@ -1527,7 +1527,7 @@ static void intel_sdvo_dpms(struct drm_connector *connector, int mode)
crtc = intel_sdvo->base.base.crtc;
if (!crtc) {
intel_sdvo->base.connectors_active = false;
return;
return 0;
}
/* We set active outputs manually below in case pipe dpms doesn't change
@ -1551,6 +1551,8 @@ static void intel_sdvo_dpms(struct drm_connector *connector, int mode)
}
intel_modeset_check_state(connector->dev);
return 0;
}
static enum drm_mode_status

View File

@ -334,13 +334,15 @@ static int mdp4_crtc_atomic_check(struct drm_crtc *crtc,
return 0;
}
static void mdp4_crtc_atomic_begin(struct drm_crtc *crtc)
static void mdp4_crtc_atomic_begin(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state)
{
struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc);
DBG("%s: begin", mdp4_crtc->name);
}
static void mdp4_crtc_atomic_flush(struct drm_crtc *crtc)
static void mdp4_crtc_atomic_flush(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state)
{
struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc);
struct drm_device *dev = crtc->dev;

View File

@ -388,13 +388,15 @@ static int mdp5_crtc_atomic_check(struct drm_crtc *crtc,
return 0;
}
static void mdp5_crtc_atomic_begin(struct drm_crtc *crtc)
static void mdp5_crtc_atomic_begin(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state)
{
struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc);
DBG("%s: begin", mdp5_crtc->name);
}
static void mdp5_crtc_atomic_flush(struct drm_crtc *crtc)
static void mdp5_crtc_atomic_flush(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state)
{
struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc);
struct drm_device *dev = crtc->dev;

View File

@ -919,7 +919,7 @@ nouveau_connector_funcs_lvds = {
.force = nouveau_connector_force
};
static void
static int
nouveau_connector_dp_dpms(struct drm_connector *connector, int mode)
{
struct nouveau_encoder *nv_encoder = NULL;
@ -938,7 +938,7 @@ nouveau_connector_dp_dpms(struct drm_connector *connector, int mode)
}
}
drm_helper_connector_dpms(connector, mode);
return drm_helper_connector_dpms(connector, mode);
}
static const struct drm_connector_funcs

View File

@ -246,9 +246,10 @@ radeon_dp_mst_connector_destroy(struct drm_connector *connector)
kfree(radeon_connector);
}
static void radeon_connector_dpms(struct drm_connector *connector, int mode)
static int radeon_connector_dpms(struct drm_connector *connector, int mode)
{
DRM_DEBUG_KMS("\n");
return 0;
}
static const struct drm_connector_funcs radeon_dp_mst_connector_funcs = {

View File

@ -496,7 +496,8 @@ static bool rcar_du_crtc_mode_fixup(struct drm_crtc *crtc,
return true;
}
static void rcar_du_crtc_atomic_begin(struct drm_crtc *crtc)
static void rcar_du_crtc_atomic_begin(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state)
{
struct drm_pending_vblank_event *event = crtc->state->event;
struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc);
@ -512,7 +513,8 @@ static void rcar_du_crtc_atomic_begin(struct drm_crtc *crtc)
}
}
static void rcar_du_crtc_atomic_flush(struct drm_crtc *crtc)
static void rcar_du_crtc_atomic_flush(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state)
{
struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc);

View File

@ -164,7 +164,8 @@ sti_drm_crtc_mode_set_nofb(struct drm_crtc *crtc)
sti_drm_crtc_mode_set(crtc, &crtc->state->adjusted_mode);
}
static void sti_drm_atomic_begin(struct drm_crtc *crtc)
static void sti_drm_atomic_begin(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state)
{
struct sti_mixer *mixer = to_sti_mixer(crtc);
@ -178,7 +179,8 @@ static void sti_drm_atomic_begin(struct drm_crtc *crtc)
}
}
static void sti_drm_atomic_flush(struct drm_crtc *crtc)
static void sti_drm_atomic_flush(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state)
{
}

View File

@ -1277,7 +1277,8 @@ static int tegra_crtc_atomic_check(struct drm_crtc *crtc,
return 0;
}
static void tegra_crtc_atomic_begin(struct drm_crtc *crtc)
static void tegra_crtc_atomic_begin(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state)
{
struct tegra_dc *dc = to_tegra_dc(crtc);
@ -1291,7 +1292,8 @@ static void tegra_crtc_atomic_begin(struct drm_crtc *crtc)
}
}
static void tegra_crtc_atomic_flush(struct drm_crtc *crtc)
static void tegra_crtc_atomic_flush(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state)
{
struct tegra_dc_state *state = to_dc_state(crtc->state);
struct tegra_dc *dc = to_tegra_dc(crtc);

View File

@ -726,8 +726,9 @@ static void tegra_dsi_soft_reset(struct tegra_dsi *dsi)
tegra_dsi_soft_reset(dsi->slave);
}
static void tegra_dsi_connector_dpms(struct drm_connector *connector, int mode)
static int tegra_dsi_connector_dpms(struct drm_connector *connector, int mode)
{
return 0;
}
static void tegra_dsi_connector_reset(struct drm_connector *connector)

View File

@ -772,9 +772,10 @@ static bool tegra_output_is_hdmi(struct tegra_output *output)
return drm_detect_hdmi_monitor(edid);
}
static void tegra_hdmi_connector_dpms(struct drm_connector *connector,
int mode)
static int tegra_hdmi_connector_dpms(struct drm_connector *connector,
int mode)
{
return 0;
}
static const struct drm_connector_funcs tegra_hdmi_connector_funcs = {

View File

@ -88,9 +88,10 @@ static void tegra_dc_write_regs(struct tegra_dc *dc,
tegra_dc_writel(dc, table[i].value, table[i].offset);
}
static void tegra_rgb_connector_dpms(struct drm_connector *connector,
int mode)
static int tegra_rgb_connector_dpms(struct drm_connector *connector,
int mode)
{
return 0;
}
static const struct drm_connector_funcs tegra_rgb_connector_funcs = {

View File

@ -866,8 +866,9 @@ static void tegra_sor_debugfs_exit(struct tegra_sor *sor)
sor->debugfs_files = NULL;
}
static void tegra_sor_connector_dpms(struct drm_connector *connector, int mode)
static int tegra_sor_connector_dpms(struct drm_connector *connector, int mode)
{
return 0;
}
static enum drm_connector_status

View File

@ -1808,8 +1808,9 @@ void vmw_du_crtc_gamma_set(struct drm_crtc *crtc,
}
}
void vmw_du_connector_dpms(struct drm_connector *connector, int mode)
int vmw_du_connector_dpms(struct drm_connector *connector, int mode)
{
return 0;
}
void vmw_du_connector_save(struct drm_connector *connector)

View File

@ -133,7 +133,7 @@ void vmw_du_crtc_gamma_set(struct drm_crtc *crtc,
int vmw_du_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv,
uint32_t handle, uint32_t width, uint32_t height);
int vmw_du_crtc_cursor_move(struct drm_crtc *crtc, int x, int y);
void vmw_du_connector_dpms(struct drm_connector *connector, int mode);
int vmw_du_connector_dpms(struct drm_connector *connector, int mode);
void vmw_du_connector_save(struct drm_connector *connector);
void vmw_du_connector_restore(struct drm_connector *connector);
enum drm_connector_status

View File

@ -166,7 +166,8 @@ int __must_check drm_atomic_async_commit(struct drm_atomic_state *state);
static inline bool
drm_atomic_crtc_needs_modeset(struct drm_crtc_state *state)
{
return state->mode_changed || state->active_changed;
return state->mode_changed || state->active_changed ||
state->connectors_changed;
}

View File

@ -87,8 +87,8 @@ int drm_atomic_helper_page_flip(struct drm_crtc *crtc,
struct drm_framebuffer *fb,
struct drm_pending_vblank_event *event,
uint32_t flags);
void drm_atomic_helper_connector_dpms(struct drm_connector *connector,
int mode);
int drm_atomic_helper_connector_dpms(struct drm_connector *connector,
int mode);
/* default implementations for state handling */
void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc);

View File

@ -255,12 +255,13 @@ struct drm_atomic_state;
* @crtc: backpointer to the CRTC
* @enable: whether the CRTC should be enabled, gates all other state
* @active: whether the CRTC is actively displaying (used for DPMS)
* @mode_changed: for use by helpers and drivers when computing state updates
* @active_changed: for use by helpers and drivers when computing state updates
* @planes_changed: planes on this crtc are updated
* @mode_changed: crtc_state->mode or crtc_state->enable has been changed
* @active_changed: crtc_state->active has been toggled.
* @connectors_changed: connectors to this crtc have been updated
* @plane_mask: bitmask of (1 << drm_plane_index(plane)) of attached planes
* @last_vblank_count: for helpers and drivers to capture the vblank of the
* update to ensure framebuffer cleanup isn't done too early
* @planes_changed: for use by helpers and drivers when computing state updates
* @adjusted_mode: for use by helpers and drivers to compute adjusted mode timings
* @mode: current mode timings
* @event: optional pointer to a DRM event to signal upon completion of the
@ -283,6 +284,7 @@ struct drm_crtc_state {
bool planes_changed : 1;
bool mode_changed : 1;
bool active_changed : 1;
bool connectors_changed : 1;
/* attached planes bitmask:
* WARNING: transitional helpers do not maintain plane_mask so
@ -525,7 +527,7 @@ struct drm_connector_state {
* etc.
*/
struct drm_connector_funcs {
void (*dpms)(struct drm_connector *connector, int mode);
int (*dpms)(struct drm_connector *connector, int mode);
void (*save)(struct drm_connector *connector);
void (*restore)(struct drm_connector *connector);
void (*reset)(struct drm_connector *connector);

View File

@ -108,8 +108,10 @@ struct drm_crtc_helper_funcs {
/* atomic helpers */
int (*atomic_check)(struct drm_crtc *crtc,
struct drm_crtc_state *state);
void (*atomic_begin)(struct drm_crtc *crtc);
void (*atomic_flush)(struct drm_crtc *crtc);
void (*atomic_begin)(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state);
void (*atomic_flush)(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state);
};
/**
@ -187,7 +189,7 @@ extern bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
extern bool drm_helper_crtc_in_use(struct drm_crtc *crtc);
extern bool drm_helper_encoder_in_use(struct drm_encoder *encoder);
extern void drm_helper_connector_dpms(struct drm_connector *connector, int mode);
extern int drm_helper_connector_dpms(struct drm_connector *connector, int mode);
extern void drm_helper_move_panel_connectors_to_head(struct drm_device *);

View File

@ -420,7 +420,7 @@
#define DP_TEST_SINK_MISC 0x246
# define DP_TEST_CRC_SUPPORTED (1 << 5)
# define DP_TEST_COUNT_MASK 0x7
# define DP_TEST_COUNT_MASK 0xf
#define DP_TEST_RESPONSE 0x260
# define DP_TEST_ACK (1 << 0)