|
24 | 24 |
|
25 | 25 | #include <linux/debugfs.h>
|
26 | 26 | #include <linux/firmware.h>
|
| 27 | +#include <drm/drm_vblank.h> |
27 | 28 |
|
28 | 29 | #include "i915_drv.h"
|
29 | 30 | #include "i915_reg.h"
|
|
35 | 36 | #include "intel_display_types.h"
|
36 | 37 | #include "intel_dmc.h"
|
37 | 38 | #include "intel_dmc_regs.h"
|
| 39 | +#include "intel_flipq.h" |
38 | 40 | #include "intel_step.h"
|
39 | 41 |
|
40 | 42 | /**
|
@@ -737,6 +739,8 @@ void intel_dmc_enable_pipe(const struct intel_crtc_state *crtc_state)
|
737 | 739 | assert_dmc_loaded(display, dmc_id);
|
738 | 740 |
|
739 | 741 | if (DISPLAY_VER(display) >= 20) {
|
| 742 | + intel_flipq_reset(display, pipe); |
| 743 | + |
740 | 744 | intel_de_write(display, PIPEDMC_INTERRUPT(pipe), pipedmc_interrupt_mask(display));
|
741 | 745 | intel_de_write(display, PIPEDMC_INTERRUPT_MASK(pipe), ~pipedmc_interrupt_mask(display));
|
742 | 746 | }
|
@@ -765,6 +769,8 @@ void intel_dmc_disable_pipe(const struct intel_crtc_state *crtc_state)
|
765 | 769 | if (DISPLAY_VER(display) >= 20) {
|
766 | 770 | intel_de_write(display, PIPEDMC_INTERRUPT_MASK(pipe), ~0);
|
767 | 771 | intel_de_write(display, PIPEDMC_INTERRUPT(pipe), pipedmc_interrupt_mask(display));
|
| 772 | + |
| 773 | + intel_flipq_reset(display, pipe); |
768 | 774 | }
|
769 | 775 | }
|
770 | 776 |
|
@@ -853,6 +859,13 @@ void intel_dmc_load_program(struct intel_display *display)
|
853 | 859 | assert_dmc_loaded(display, dmc_id);
|
854 | 860 | }
|
855 | 861 |
|
| 862 | + if (DISPLAY_VER(display) >= 20) |
| 863 | + intel_de_write(display, DMC_FQ_W2_PTS_CFG_SEL, |
| 864 | + PIPE_D_DMC_W2_PTS_CONFIG_SELECT(PIPE_D) | |
| 865 | + PIPE_C_DMC_W2_PTS_CONFIG_SELECT(PIPE_C) | |
| 866 | + PIPE_B_DMC_W2_PTS_CONFIG_SELECT(PIPE_B) | |
| 867 | + PIPE_A_DMC_W2_PTS_CONFIG_SELECT(PIPE_A)); |
| 868 | + |
856 | 869 | power_domains->dc_state = 0;
|
857 | 870 |
|
858 | 871 | gen9_set_dc_state_debugmask(display);
|
@@ -1371,6 +1384,17 @@ void intel_dmc_suspend(struct intel_display *display)
|
1371 | 1384 | intel_dmc_runtime_pm_put(display);
|
1372 | 1385 | }
|
1373 | 1386 |
|
| 1387 | +void intel_dmc_wait_fw_load(struct intel_display *display) |
| 1388 | +{ |
| 1389 | + struct intel_dmc *dmc = display_to_dmc(display); |
| 1390 | + |
| 1391 | + if (!HAS_DMC(display)) |
| 1392 | + return; |
| 1393 | + |
| 1394 | + if (dmc) |
| 1395 | + flush_work(&dmc->work); |
| 1396 | +} |
| 1397 | + |
1374 | 1398 | /**
|
1375 | 1399 | * intel_dmc_resume() - init DMC firmware during system resume
|
1376 | 1400 | * @display: display instance
|
@@ -1606,3 +1630,30 @@ void intel_pipedmc_irq_handler(struct intel_display *display, enum pipe pipe)
|
1606 | 1630 | drm_err(display->drm, "[CRTC:%d:%s]] PIPEDMC interrupt vector 0x%x\n",
|
1607 | 1631 | crtc->base.base.id, crtc->base.name, tmp);
|
1608 | 1632 | }
|
| 1633 | + |
| 1634 | +void intel_pipedmc_enable_event(struct intel_crtc *crtc, |
| 1635 | + enum pipedmc_event_id event) |
| 1636 | +{ |
| 1637 | + struct intel_display *display = to_intel_display(crtc); |
| 1638 | + enum intel_dmc_id dmc_id = PIPE_TO_DMC_ID(crtc->pipe); |
| 1639 | + |
| 1640 | + dmc_configure_event(display, dmc_id, event, true); |
| 1641 | +} |
| 1642 | + |
| 1643 | +void intel_pipedmc_disable_event(struct intel_crtc *crtc, |
| 1644 | + enum pipedmc_event_id event) |
| 1645 | +{ |
| 1646 | + struct intel_display *display = to_intel_display(crtc); |
| 1647 | + enum intel_dmc_id dmc_id = PIPE_TO_DMC_ID(crtc->pipe); |
| 1648 | + |
| 1649 | + dmc_configure_event(display, dmc_id, event, false); |
| 1650 | +} |
| 1651 | + |
| 1652 | +u32 intel_pipedmc_start_mmioaddr(struct intel_crtc *crtc) |
| 1653 | +{ |
| 1654 | + struct intel_display *display = to_intel_display(crtc); |
| 1655 | + struct intel_dmc *dmc = display_to_dmc(display); |
| 1656 | + enum intel_dmc_id dmc_id = PIPE_TO_DMC_ID(crtc->pipe); |
| 1657 | + |
| 1658 | + return dmc ? dmc->dmc_info[dmc_id].start_mmioaddr : 0; |
| 1659 | +} |
0 commit comments