Skip to content

Commit be2fce7

Browse files
committed
drm/i915/dmc: Also disable the flip queue event on TGL main DMC
Unlike later platforms TGL has its flip queue event (CLK_MSEC) on the main DMC (as opposed to the pipe DMC). Currently we're doing a second pass to disable that, but let's just follow the same approach as the later platforms and never even enable the event in the first place. Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Imre Deak <[email protected]>
1 parent 648d7be commit be2fce7

File tree

1 file changed

+5
-78
lines changed

1 file changed

+5
-78
lines changed

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

Lines changed: 5 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -335,77 +335,6 @@ static void disable_event_handler(struct drm_i915_private *i915,
335335
intel_de_write(i915, htp_reg, 0);
336336
}
337337

338-
static void
339-
disable_flip_queue_event(struct drm_i915_private *i915,
340-
i915_reg_t ctl_reg, i915_reg_t htp_reg)
341-
{
342-
u32 event_ctl;
343-
u32 event_htp;
344-
345-
event_ctl = intel_de_read(i915, ctl_reg);
346-
event_htp = intel_de_read(i915, htp_reg);
347-
if (event_ctl != (DMC_EVT_CTL_ENABLE |
348-
DMC_EVT_CTL_RECURRING |
349-
REG_FIELD_PREP(DMC_EVT_CTL_TYPE_MASK,
350-
DMC_EVT_CTL_TYPE_EDGE_0_1) |
351-
REG_FIELD_PREP(DMC_EVT_CTL_EVENT_ID_MASK,
352-
DMC_EVT_CTL_EVENT_ID_CLK_MSEC)) ||
353-
!event_htp) {
354-
drm_dbg_kms(&i915->drm,
355-
"Unexpected DMC event configuration (control %08x htp %08x)\n",
356-
event_ctl, event_htp);
357-
return;
358-
}
359-
360-
disable_event_handler(i915, ctl_reg, htp_reg);
361-
}
362-
363-
static bool
364-
get_flip_queue_event_regs(struct drm_i915_private *i915, enum intel_dmc_id dmc_id,
365-
i915_reg_t *ctl_reg, i915_reg_t *htp_reg)
366-
{
367-
if (dmc_id == DMC_FW_MAIN) {
368-
if (DISPLAY_VER(i915) == 12) {
369-
*ctl_reg = DMC_EVT_CTL(i915, dmc_id, 3);
370-
*htp_reg = DMC_EVT_HTP(i915, dmc_id, 3);
371-
372-
return true;
373-
}
374-
} else if (dmc_id >= DMC_FW_PIPEA && dmc_id <= DMC_FW_PIPED) {
375-
if (IS_DG2(i915)) {
376-
*ctl_reg = DMC_EVT_CTL(i915, dmc_id, 2);
377-
*htp_reg = DMC_EVT_HTP(i915, dmc_id, 2);
378-
379-
return true;
380-
}
381-
}
382-
383-
return false;
384-
}
385-
386-
static void
387-
disable_all_flip_queue_events(struct drm_i915_private *i915)
388-
{
389-
enum intel_dmc_id dmc_id;
390-
391-
/* TODO: check if the following applies to all D13+ platforms. */
392-
if (!IS_TIGERLAKE(i915))
393-
return;
394-
395-
for_each_dmc_id(dmc_id) {
396-
i915_reg_t ctl_reg;
397-
i915_reg_t htp_reg;
398-
399-
if (!has_dmc_id_fw(i915, dmc_id))
400-
continue;
401-
402-
if (!get_flip_queue_event_regs(i915, dmc_id, &ctl_reg, &htp_reg))
403-
continue;
404-
405-
disable_flip_queue_event(i915, ctl_reg, htp_reg);
406-
}
407-
}
408-
409338
static void disable_all_event_handlers(struct drm_i915_private *i915)
410339
{
411340
enum intel_dmc_id dmc_id;
@@ -514,6 +443,11 @@ static bool disable_dmc_evt(struct drm_i915_private *i915,
514443
if (dmc_id != DMC_FW_MAIN)
515444
return true;
516445

446+
/* also disable the flip queue event on the main DMC on TGL */
447+
if (IS_TIGERLAKE(i915) &&
448+
REG_FIELD_GET(DMC_EVT_CTL_EVENT_ID_MASK, data) == DMC_EVT_CTL_EVENT_ID_CLK_MSEC)
449+
return true;
450+
517451
return false;
518452
}
519453

@@ -579,13 +513,6 @@ void intel_dmc_load_program(struct drm_i915_private *i915)
579513

580514
gen9_set_dc_state_debugmask(i915);
581515

582-
/*
583-
* Flip queue events need to be disabled before enabling DC5/6.
584-
* i915 doesn't use the flip queue feature, so disable it already
585-
* here.
586-
*/
587-
disable_all_flip_queue_events(i915);
588-
589516
pipedmc_clock_gating_wa(i915, false);
590517
}
591518

0 commit comments

Comments
 (0)