Skip to content

Commit 64cf40a

Browse files
elongbugzehortigoza
authored andcommitted
drm/i915/psr: Program default IO buffer Wake and Fast Wake
The IO buffer Wake and Fast Wake bit size and value have been changed from Gen12+. It programs the default value of IO buffer Wake and Fast Wake on Gen12+. It adds definitions of IO buffer Wake and Fast Wake for pre Gen12 and Gen12+. And it aligns PSR2 definition macros. v2: Fix macro definitions. (José) v3: Addressed review comments from José - Add missing default values of IO_BUFFER_WAKE and FAST_WAKE for GEN9+ - Change a style of macro naming in order to use lines as input. - Update Todo comments. v4: Add parentheses to macros to avoid precedence issues. Cc: José Roberto de Souza <jose.souza@intel.com> Signed-off-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200607143614.185246-1-gwan-gyeong.mun@intel.com
1 parent 8c1a8f1 commit 64cf40a

File tree

2 files changed

+49
-19
lines changed

2 files changed

+49
-19
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,22 @@ static void hsw_activate_psr2(struct intel_dp *intel_dp)
537537
val |= EDP_PSR2_FRAME_BEFORE_SU(dev_priv->psr.sink_sync_latency + 1);
538538
val |= intel_psr2_get_tp_time(intel_dp);
539539

540+
if (INTEL_GEN(dev_priv) >= 12) {
541+
/*
542+
* TODO: 7 lines of IO_BUFFER_WAKE and FAST_WAKE are default
543+
* values from BSpec. In order to setting an optimal power
544+
* consumption, lower than 4k resoluition mode needs to decrese
545+
* IO_BUFFER_WAKE and FAST_WAKE. And higher than 4K resolution
546+
* mode needs to increase IO_BUFFER_WAKE and FAST_WAKE.
547+
*/
548+
val |= TGL_EDP_PSR2_BLOCK_COUNT_NUM_2;
549+
val |= TGL_EDP_PSR2_IO_BUFFER_WAKE(7);
550+
val |= TGL_EDP_PSR2_FAST_WAKE(7);
551+
} else if (INTEL_GEN(dev_priv) >= 9) {
552+
val |= EDP_PSR2_IO_BUFFER_WAKE(7);
553+
val |= EDP_PSR2_FAST_WAKE(7);
554+
}
555+
540556
/*
541557
* PSR2 HW is incorrectly using EDP_PSR_TP1_TP3_SEL and BSpec is
542558
* recommending keep this bit unset while PSR2 is enabled.

drivers/gpu/drm/i915/i915_reg.h

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4511,25 +4511,39 @@ enum {
45114511
#define EDP_PSR_DEBUG_MASK_DISP_REG_WRITE (1 << 16) /* Reserved in ICL+ */
45124512
#define EDP_PSR_DEBUG_EXIT_ON_PIXEL_UNDERRUN (1 << 15) /* SKL+ */
45134513

4514-
#define _PSR2_CTL_A 0x60900
4515-
#define _PSR2_CTL_EDP 0x6f900
4516-
#define EDP_PSR2_CTL(tran) _MMIO_TRANS2(tran, _PSR2_CTL_A)
4517-
#define EDP_PSR2_ENABLE (1 << 31)
4518-
#define EDP_SU_TRACK_ENABLE (1 << 30)
4519-
#define EDP_Y_COORDINATE_VALID (1 << 26) /* GLK and CNL+ */
4520-
#define EDP_Y_COORDINATE_ENABLE (1 << 25) /* GLK and CNL+ */
4521-
#define EDP_MAX_SU_DISABLE_TIME(t) ((t) << 20)
4522-
#define EDP_MAX_SU_DISABLE_TIME_MASK (0x1f << 20)
4523-
#define EDP_PSR2_TP2_TIME_500us (0 << 8)
4524-
#define EDP_PSR2_TP2_TIME_100us (1 << 8)
4525-
#define EDP_PSR2_TP2_TIME_2500us (2 << 8)
4526-
#define EDP_PSR2_TP2_TIME_50us (3 << 8)
4527-
#define EDP_PSR2_TP2_TIME_MASK (3 << 8)
4528-
#define EDP_PSR2_FRAME_BEFORE_SU_SHIFT 4
4529-
#define EDP_PSR2_FRAME_BEFORE_SU_MASK (0xf << 4)
4530-
#define EDP_PSR2_FRAME_BEFORE_SU(a) ((a) << 4)
4531-
#define EDP_PSR2_IDLE_FRAME_MASK 0xf
4532-
#define EDP_PSR2_IDLE_FRAME_SHIFT 0
4514+
#define _PSR2_CTL_A 0x60900
4515+
#define _PSR2_CTL_EDP 0x6f900
4516+
#define EDP_PSR2_CTL(tran) _MMIO_TRANS2(tran, _PSR2_CTL_A)
4517+
#define EDP_PSR2_ENABLE (1 << 31)
4518+
#define EDP_SU_TRACK_ENABLE (1 << 30)
4519+
#define TGL_EDP_PSR2_BLOCK_COUNT_NUM_2 (0 << 28)
4520+
#define TGL_EDP_PSR2_BLOCK_COUNT_NUM_3 (1 << 28)
4521+
#define EDP_Y_COORDINATE_VALID (1 << 26) /* GLK and CNL+ */
4522+
#define EDP_Y_COORDINATE_ENABLE (1 << 25) /* GLK and CNL+ */
4523+
#define EDP_MAX_SU_DISABLE_TIME(t) ((t) << 20)
4524+
#define EDP_MAX_SU_DISABLE_TIME_MASK (0x1f << 20)
4525+
#define EDP_PSR2_IO_BUFFER_WAKE_MAX_LINES 8
4526+
#define EDP_PSR2_IO_BUFFER_WAKE(lines) ((EDP_PSR2_IO_BUFFER_WAKE_MAX_LINES - (lines)) << 13)
4527+
#define EDP_PSR2_IO_BUFFER_WAKE_MASK (3 << 13)
4528+
#define TGL_EDP_PSR2_IO_BUFFER_WAKE_MIN_LINES 5
4529+
#define TGL_EDP_PSR2_IO_BUFFER_WAKE(lines) (((lines) - TGL_EDP_PSR2_IO_BUFFER_WAKE_MIN_LINES) << 13)
4530+
#define TGL_EDP_PSR2_IO_BUFFER_WAKE_MASK (7 << 13)
4531+
#define EDP_PSR2_FAST_WAKE_MAX_LINES 8
4532+
#define EDP_PSR2_FAST_WAKE(lines) ((EDP_PSR2_FAST_WAKE_MAX_LINES - (lines)) << 11)
4533+
#define EDP_PSR2_FAST_WAKE_MASK (3 << 11)
4534+
#define TGL_EDP_PSR2_FAST_WAKE_MIN_LINES 5
4535+
#define TGL_EDP_PSR2_FAST_WAKE(lines) (((lines) - TGL_EDP_PSR2_FAST_WAKE_MIN_LINES) << 10)
4536+
#define TGL_EDP_PSR2_FAST_WAKE_MASK (7 << 10)
4537+
#define EDP_PSR2_TP2_TIME_500us (0 << 8)
4538+
#define EDP_PSR2_TP2_TIME_100us (1 << 8)
4539+
#define EDP_PSR2_TP2_TIME_2500us (2 << 8)
4540+
#define EDP_PSR2_TP2_TIME_50us (3 << 8)
4541+
#define EDP_PSR2_TP2_TIME_MASK (3 << 8)
4542+
#define EDP_PSR2_FRAME_BEFORE_SU_SHIFT 4
4543+
#define EDP_PSR2_FRAME_BEFORE_SU_MASK (0xf << 4)
4544+
#define EDP_PSR2_FRAME_BEFORE_SU(a) ((a) << 4)
4545+
#define EDP_PSR2_IDLE_FRAME_MASK 0xf
4546+
#define EDP_PSR2_IDLE_FRAME_SHIFT 0
45334547

45344548
#define _PSR_EVENT_TRANS_A 0x60848
45354549
#define _PSR_EVENT_TRANS_B 0x61848

0 commit comments

Comments
 (0)