drm/i915: Clean up intel_atomic_setup_scalers slightly.
Get rid of a whole lot of ternary operators and assign the index in scaler_id, instead of the id. They're the same thing. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Tested-by(IVB): Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
b359283a03
commit
133b0d128b
|
@ -309,15 +309,23 @@ int intel_atomic_setup_scalers(struct drm_device *dev,
|
||||||
/* walkthrough scaler_users bits and start assigning scalers */
|
/* walkthrough scaler_users bits and start assigning scalers */
|
||||||
for (i = 0; i < sizeof(scaler_state->scaler_users) * 8; i++) {
|
for (i = 0; i < sizeof(scaler_state->scaler_users) * 8; i++) {
|
||||||
int *scaler_id;
|
int *scaler_id;
|
||||||
|
const char *name;
|
||||||
|
int idx;
|
||||||
|
|
||||||
/* skip if scaler not required */
|
/* skip if scaler not required */
|
||||||
if (!(scaler_state->scaler_users & (1 << i)))
|
if (!(scaler_state->scaler_users & (1 << i)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (i == SKL_CRTC_INDEX) {
|
if (i == SKL_CRTC_INDEX) {
|
||||||
|
name = "CRTC";
|
||||||
|
idx = intel_crtc->base.base.id;
|
||||||
|
|
||||||
/* panel fitter case: assign as a crtc scaler */
|
/* panel fitter case: assign as a crtc scaler */
|
||||||
scaler_id = &scaler_state->scaler_id;
|
scaler_id = &scaler_state->scaler_id;
|
||||||
} else {
|
} else {
|
||||||
|
name = "PLANE";
|
||||||
|
idx = plane->base.id;
|
||||||
|
|
||||||
if (!drm_state)
|
if (!drm_state)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -356,23 +364,16 @@ int intel_atomic_setup_scalers(struct drm_device *dev,
|
||||||
for (j = 0; j < intel_crtc->num_scalers; j++) {
|
for (j = 0; j < intel_crtc->num_scalers; j++) {
|
||||||
if (!scaler_state->scalers[j].in_use) {
|
if (!scaler_state->scalers[j].in_use) {
|
||||||
scaler_state->scalers[j].in_use = 1;
|
scaler_state->scalers[j].in_use = 1;
|
||||||
*scaler_id = scaler_state->scalers[j].id;
|
*scaler_id = j;
|
||||||
DRM_DEBUG_KMS("Attached scaler id %u.%u to %s:%d\n",
|
DRM_DEBUG_KMS("Attached scaler id %u.%u to %s:%d\n",
|
||||||
intel_crtc->pipe,
|
intel_crtc->pipe, *scaler_id, name, idx);
|
||||||
i == SKL_CRTC_INDEX ? scaler_state->scaler_id :
|
|
||||||
plane_state->scaler_id,
|
|
||||||
i == SKL_CRTC_INDEX ? "CRTC" : "PLANE",
|
|
||||||
i == SKL_CRTC_INDEX ? intel_crtc->base.base.id :
|
|
||||||
plane->base.id);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WARN_ON(*scaler_id < 0)) {
|
if (WARN_ON(*scaler_id < 0)) {
|
||||||
DRM_DEBUG_KMS("Cannot find scaler for %s:%d\n",
|
DRM_DEBUG_KMS("Cannot find scaler for %s:%d\n", name, idx);
|
||||||
i == SKL_CRTC_INDEX ? "CRTC" : "PLANE",
|
|
||||||
i == SKL_CRTC_INDEX ? intel_crtc->base.base.id:plane->base.id);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14070,8 +14070,6 @@ static void skl_init_scalers(struct drm_device *dev, struct intel_crtc *intel_cr
|
||||||
for (i = 0; i < intel_crtc->num_scalers; i++) {
|
for (i = 0; i < intel_crtc->num_scalers; i++) {
|
||||||
intel_scaler = &scaler_state->scalers[i];
|
intel_scaler = &scaler_state->scalers[i];
|
||||||
intel_scaler->in_use = 0;
|
intel_scaler->in_use = 0;
|
||||||
intel_scaler->id = i;
|
|
||||||
|
|
||||||
intel_scaler->mode = PS_SCALER_MODE_DYN;
|
intel_scaler->mode = PS_SCALER_MODE_DYN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -293,7 +293,6 @@ struct intel_initial_plane_config {
|
||||||
#define SKL_MAX_DST_H 4096
|
#define SKL_MAX_DST_H 4096
|
||||||
|
|
||||||
struct intel_scaler {
|
struct intel_scaler {
|
||||||
int id;
|
|
||||||
int in_use;
|
int in_use;
|
||||||
uint32_t mode;
|
uint32_t mode;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue