Skip to content

Commit 1ec9686

Browse files
committed
drm/i915: Extract intel_bw_crtc_disable_noatomic()
Hoist the bw stuff into a separate function from intel_crtc_disable_noatomic_complete() so that the details are better hidden inside intel_bw.c. We can also skip the whole thing on pre-skl since the dbuf state isn't actually used on those platforms. Reviewed-by: Vinod Govindapillai <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent d34b59d commit 1ec9686

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

drivers/gpu/drm/i915/display/intel_bw.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,6 +1422,20 @@ int intel_bw_atomic_check(struct intel_atomic_state *state)
14221422
return 0;
14231423
}
14241424

1425+
void intel_bw_crtc_disable_noatomic(struct intel_crtc *crtc)
1426+
{
1427+
struct intel_display *display = to_intel_display(crtc);
1428+
struct intel_bw_state *bw_state =
1429+
to_intel_bw_state(display->bw.obj.state);
1430+
enum pipe pipe = crtc->pipe;
1431+
1432+
if (DISPLAY_VER(display) < 9)
1433+
return;
1434+
1435+
bw_state->data_rate[pipe] = 0;
1436+
bw_state->num_active_planes[pipe] = 0;
1437+
}
1438+
14251439
static struct intel_global_state *
14261440
intel_bw_duplicate_state(struct intel_global_obj *obj)
14271441
{

drivers/gpu/drm/i915/display/intel_bw.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
struct drm_i915_private;
1616
struct intel_atomic_state;
17+
struct intel_crtc;
1718
struct intel_crtc_state;
1819

1920
struct intel_dbuf_bw {
@@ -81,5 +82,6 @@ int intel_bw_calc_min_cdclk(struct intel_atomic_state *state,
8182
bool *need_cdclk_calc);
8283
int intel_bw_min_cdclk(struct drm_i915_private *i915,
8384
const struct intel_bw_state *bw_state);
85+
void intel_bw_crtc_disable_noatomic(struct intel_crtc *crtc);
8486

8587
#endif /* __INTEL_BW_H__ */

drivers/gpu/drm/i915/display/intel_modeset_setup.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,6 @@ static void intel_crtc_disable_noatomic_complete(struct intel_crtc *crtc)
156156
{
157157
struct intel_display *display = to_intel_display(crtc);
158158
struct drm_i915_private *i915 = to_i915(crtc->base.dev);
159-
struct intel_bw_state *bw_state =
160-
to_intel_bw_state(i915->display.bw.obj.state);
161159
struct intel_pmdemand_state *pmdemand_state =
162160
to_intel_pmdemand_state(i915->display.pmdemand.obj.state);
163161
struct intel_crtc_state *crtc_state =
@@ -177,9 +175,7 @@ static void intel_crtc_disable_noatomic_complete(struct intel_crtc *crtc)
177175

178176
intel_cdclk_crtc_disable_noatomic(crtc);
179177
skl_wm_crtc_disable_noatomic(crtc);
180-
181-
bw_state->data_rate[pipe] = 0;
182-
bw_state->num_active_planes[pipe] = 0;
178+
intel_bw_crtc_disable_noatomic(crtc);
183179

184180
intel_pmdemand_update_port_clock(display, pmdemand_state, pipe, 0);
185181
}

0 commit comments

Comments
 (0)