Skip to content

Commit 70a101f

Browse files
mattropedanvet
authored andcommitted
drm/i915: Switch to full atomic helpers for plane updates/disable, take two
Switch from our plane update/disable entrypoints to use the full atomic helpers (which generate a top-level atomic transaction) rather than the transitional helpers (which only create/manipulate orphaned plane states independent of a top-level transaction). Various upcoming work (SKL scalers, atomic watermarks, etc.) requires a full atomic transaction to behave properly/cleanly. Last time we tried this, we had to back out the change because we still call the drm_plane vfuncs directly from within our legacy modesetting code. This potentially results in nested atomic transactions, locking collisions, and other failures. To avoid that problem again, we sidestep the issue by calling the transitional helpers directly (rather than through a vfunc) when we're nested inside of other legacy modesetting code. However this does allow legacy SetPlane() ioctl's to process an entire drm_atomic_state transaction, which is important for upcoming patches. Cc: Chandra Konduru <[email protected]> Signed-off-by: Matt Roper <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
1 parent 3e1ab4b commit 70a101f

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

drivers/gpu/drm/i915/intel_display.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5576,7 +5576,7 @@ static void intel_crtc_disable(struct drm_crtc *crtc)
55765576
dev_priv->display.crtc_disable(crtc);
55775577
dev_priv->display.off(crtc);
55785578

5579-
crtc->primary->funcs->disable_plane(crtc->primary);
5579+
drm_plane_helper_disable(crtc->primary);
55805580

55815581
/* Update computed state. */
55825582
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
@@ -11731,11 +11731,11 @@ static int __intel_set_mode(struct drm_crtc *crtc,
1173111731
int vdisplay, hdisplay;
1173211732

1173311733
drm_crtc_get_hv_timing(mode, &hdisplay, &vdisplay);
11734-
ret = primary->funcs->update_plane(primary, &intel_crtc->base,
11735-
fb, 0, 0,
11736-
hdisplay, vdisplay,
11737-
x << 16, y << 16,
11738-
hdisplay << 16, vdisplay << 16);
11734+
ret = drm_plane_helper_update(primary, &intel_crtc->base,
11735+
fb, 0, 0,
11736+
hdisplay, vdisplay,
11737+
x << 16, y << 16,
11738+
hdisplay << 16, vdisplay << 16);
1173911739
}
1174011740

1174111741
/* Now enable the clocks, plane, pipe, and connectors that we set up. */
@@ -12286,10 +12286,10 @@ static int intel_crtc_set_config(struct drm_mode_set *set)
1228612286
int vdisplay, hdisplay;
1228712287

1228812288
drm_crtc_get_hv_timing(set->mode, &hdisplay, &vdisplay);
12289-
ret = primary->funcs->update_plane(primary, set->crtc, set->fb,
12290-
0, 0, hdisplay, vdisplay,
12291-
set->x << 16, set->y << 16,
12292-
hdisplay << 16, vdisplay << 16);
12289+
ret = drm_plane_helper_update(primary, set->crtc, set->fb,
12290+
0, 0, hdisplay, vdisplay,
12291+
set->x << 16, set->y << 16,
12292+
hdisplay << 16, vdisplay << 16);
1229312293

1229412294
/*
1229512295
* We need to make sure the primary plane is re-enabled if it
@@ -12773,8 +12773,8 @@ void intel_plane_destroy(struct drm_plane *plane)
1277312773
}
1277412774

1277512775
const struct drm_plane_funcs intel_plane_funcs = {
12776-
.update_plane = drm_plane_helper_update,
12777-
.disable_plane = drm_plane_helper_disable,
12776+
.update_plane = drm_atomic_helper_update_plane,
12777+
.disable_plane = drm_atomic_helper_disable_plane,
1277812778
.destroy = intel_plane_destroy,
1277912779
.set_property = drm_atomic_helper_plane_set_property,
1278012780
.atomic_get_property = intel_plane_atomic_get_property,

drivers/gpu/drm/i915/intel_sprite.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,11 +1139,11 @@ int intel_plane_restore(struct drm_plane *plane)
11391139
if (!plane->crtc || !plane->state->fb)
11401140
return 0;
11411141

1142-
return plane->funcs->update_plane(plane, plane->crtc, plane->state->fb,
1143-
plane->state->crtc_x, plane->state->crtc_y,
1144-
plane->state->crtc_w, plane->state->crtc_h,
1145-
plane->state->src_x, plane->state->src_y,
1146-
plane->state->src_w, plane->state->src_h);
1142+
return drm_plane_helper_update(plane, plane->crtc, plane->state->fb,
1143+
plane->state->crtc_x, plane->state->crtc_y,
1144+
plane->state->crtc_w, plane->state->crtc_h,
1145+
plane->state->src_x, plane->state->src_y,
1146+
plane->state->src_w, plane->state->src_h);
11471147
}
11481148

11491149
static uint32_t ilk_plane_formats[] = {

0 commit comments

Comments
 (0)