Skip to content

Commit 2edb79a

Browse files
committed
Merge tag 'drm-intel-fixes-2022-09-08' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
- Fix MIPI sequence block copy from BIOS' table. (Ville) - Fix PCODE min freq setup when GuC's SLPC is in use. (Rodrigo) - Implement Workaround for eDP. (Ville) - Fix has_flat_ccs selection for DG1. (Matt) Signed-off-by: Dave Airlie <[email protected]> From: Rodrigo Vivi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents b34c1d5 + 151e0e0 commit 2edb79a

File tree

7 files changed

+94
-11
lines changed

7 files changed

+94
-11
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,13 @@ init_bdb_block(struct drm_i915_private *i915,
479479

480480
block_size = get_blocksize(block);
481481

482+
/*
483+
* Version number and new block size are considered
484+
* part of the header for MIPI sequenece block v3+.
485+
*/
486+
if (section_id == BDB_MIPI_SEQUENCE && *(const u8 *)block >= 3)
487+
block_size += 5;
488+
482489
entry = kzalloc(struct_size(entry, data, max(min_size, block_size) + 3),
483490
GFP_KERNEL);
484491
if (!entry) {

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,28 @@ intel_dp_prepare_link_train(struct intel_dp *intel_dp,
671671
intel_dp_compute_rate(intel_dp, crtc_state->port_clock,
672672
&link_bw, &rate_select);
673673

674+
/*
675+
* WaEdpLinkRateDataReload
676+
*
677+
* Parade PS8461E MUX (used on varius TGL+ laptops) needs
678+
* to snoop the link rates reported by the sink when we
679+
* use LINK_RATE_SET in order to operate in jitter cleaning
680+
* mode (as opposed to redriver mode). Unfortunately it
681+
* loses track of the snooped link rates when powered down,
682+
* so we need to make it re-snoop often. Without this high
683+
* link rates are not stable.
684+
*/
685+
if (!link_bw) {
686+
struct intel_connector *connector = intel_dp->attached_connector;
687+
__le16 sink_rates[DP_MAX_SUPPORTED_RATES];
688+
689+
drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] Reloading eDP link rates\n",
690+
connector->base.base.id, connector->base.name);
691+
692+
drm_dp_dpcd_read(&intel_dp->aux, DP_SUPPORTED_LINK_RATES,
693+
sink_rates, sizeof(sink_rates));
694+
}
695+
674696
if (link_bw)
675697
drm_dbg_kms(&i915->drm,
676698
"[ENCODER:%d:%s] Using LINK_BW_SET value %02x\n",

drivers/gpu/drm/i915/gem/i915_gem_object.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,9 @@ bool i915_gem_object_needs_ccs_pages(struct drm_i915_gem_object *obj)
723723
bool lmem_placement = false;
724724
int i;
725725

726+
if (!HAS_FLAT_CCS(to_i915(obj->base.dev)))
727+
return false;
728+
726729
for (i = 0; i < obj->mm.n_placements; i++) {
727730
/* Compression is not allowed for the objects with smem placement */
728731
if (obj->mm.placements[i]->type == INTEL_MEMORY_SYSTEM)

drivers/gpu/drm/i915/gem/i915_gem_ttm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ static struct ttm_tt *i915_ttm_tt_create(struct ttm_buffer_object *bo,
297297
i915_tt->is_shmem = true;
298298
}
299299

300-
if (HAS_FLAT_CCS(i915) && i915_gem_object_needs_ccs_pages(obj))
300+
if (i915_gem_object_needs_ccs_pages(obj))
301301
ccs_pages = DIV_ROUND_UP(DIV_ROUND_UP(bo->base.size,
302302
NUM_BYTES_PER_CCS_BYTE),
303303
PAGE_SIZE);

drivers/gpu/drm/i915/gt/intel_llc.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "intel_llc.h"
1313
#include "intel_mchbar_regs.h"
1414
#include "intel_pcode.h"
15+
#include "intel_rps.h"
1516

1617
struct ia_constants {
1718
unsigned int min_gpu_freq;
@@ -55,23 +56,15 @@ static bool get_ia_constants(struct intel_llc *llc,
5556
if (!HAS_LLC(i915) || IS_DGFX(i915))
5657
return false;
5758

58-
if (rps->max_freq <= rps->min_freq)
59-
return false;
60-
6159
consts->max_ia_freq = cpu_max_MHz();
6260

6361
consts->min_ring_freq =
6462
intel_uncore_read(llc_to_gt(llc)->uncore, DCLK) & 0xf;
6563
/* convert DDR frequency from units of 266.6MHz to bandwidth */
6664
consts->min_ring_freq = mult_frac(consts->min_ring_freq, 8, 3);
6765

68-
consts->min_gpu_freq = rps->min_freq;
69-
consts->max_gpu_freq = rps->max_freq;
70-
if (GRAPHICS_VER(i915) >= 9) {
71-
/* Convert GT frequency to 50 HZ units */
72-
consts->min_gpu_freq /= GEN9_FREQ_SCALER;
73-
consts->max_gpu_freq /= GEN9_FREQ_SCALER;
74-
}
66+
consts->min_gpu_freq = intel_rps_get_min_raw_freq(rps);
67+
consts->max_gpu_freq = intel_rps_get_max_raw_freq(rps);
7568

7669
return true;
7770
}
@@ -130,6 +123,12 @@ static void gen6_update_ring_freq(struct intel_llc *llc)
130123
if (!get_ia_constants(llc, &consts))
131124
return;
132125

126+
/*
127+
* Although this is unlikely on any platform during initialization,
128+
* let's ensure we don't get accidentally into infinite loop
129+
*/
130+
if (consts.max_gpu_freq <= consts.min_gpu_freq)
131+
return;
133132
/*
134133
* For each potential GPU frequency, load a ring frequency we'd like
135134
* to use for memory access. We do this by specifying the IA frequency

drivers/gpu/drm/i915/gt/intel_rps.c

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2126,6 +2126,31 @@ u32 intel_rps_get_max_frequency(struct intel_rps *rps)
21262126
return intel_gpu_freq(rps, rps->max_freq_softlimit);
21272127
}
21282128

2129+
/**
2130+
* intel_rps_get_max_raw_freq - returns the max frequency in some raw format.
2131+
* @rps: the intel_rps structure
2132+
*
2133+
* Returns the max frequency in a raw format. In newer platforms raw is in
2134+
* units of 50 MHz.
2135+
*/
2136+
u32 intel_rps_get_max_raw_freq(struct intel_rps *rps)
2137+
{
2138+
struct intel_guc_slpc *slpc = rps_to_slpc(rps);
2139+
u32 freq;
2140+
2141+
if (rps_uses_slpc(rps)) {
2142+
return DIV_ROUND_CLOSEST(slpc->rp0_freq,
2143+
GT_FREQUENCY_MULTIPLIER);
2144+
} else {
2145+
freq = rps->max_freq;
2146+
if (GRAPHICS_VER(rps_to_i915(rps)) >= 9) {
2147+
/* Convert GT frequency to 50 MHz units */
2148+
freq /= GEN9_FREQ_SCALER;
2149+
}
2150+
return freq;
2151+
}
2152+
}
2153+
21292154
u32 intel_rps_get_rp0_frequency(struct intel_rps *rps)
21302155
{
21312156
struct intel_guc_slpc *slpc = rps_to_slpc(rps);
@@ -2214,6 +2239,31 @@ u32 intel_rps_get_min_frequency(struct intel_rps *rps)
22142239
return intel_gpu_freq(rps, rps->min_freq_softlimit);
22152240
}
22162241

2242+
/**
2243+
* intel_rps_get_min_raw_freq - returns the min frequency in some raw format.
2244+
* @rps: the intel_rps structure
2245+
*
2246+
* Returns the min frequency in a raw format. In newer platforms raw is in
2247+
* units of 50 MHz.
2248+
*/
2249+
u32 intel_rps_get_min_raw_freq(struct intel_rps *rps)
2250+
{
2251+
struct intel_guc_slpc *slpc = rps_to_slpc(rps);
2252+
u32 freq;
2253+
2254+
if (rps_uses_slpc(rps)) {
2255+
return DIV_ROUND_CLOSEST(slpc->min_freq,
2256+
GT_FREQUENCY_MULTIPLIER);
2257+
} else {
2258+
freq = rps->min_freq;
2259+
if (GRAPHICS_VER(rps_to_i915(rps)) >= 9) {
2260+
/* Convert GT frequency to 50 MHz units */
2261+
freq /= GEN9_FREQ_SCALER;
2262+
}
2263+
return freq;
2264+
}
2265+
}
2266+
22172267
static int set_min_freq(struct intel_rps *rps, u32 val)
22182268
{
22192269
int ret = 0;

drivers/gpu/drm/i915/gt/intel_rps.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ u32 intel_rps_get_cagf(struct intel_rps *rps, u32 rpstat1);
3737
u32 intel_rps_read_actual_frequency(struct intel_rps *rps);
3838
u32 intel_rps_get_requested_frequency(struct intel_rps *rps);
3939
u32 intel_rps_get_min_frequency(struct intel_rps *rps);
40+
u32 intel_rps_get_min_raw_freq(struct intel_rps *rps);
4041
int intel_rps_set_min_frequency(struct intel_rps *rps, u32 val);
4142
u32 intel_rps_get_max_frequency(struct intel_rps *rps);
43+
u32 intel_rps_get_max_raw_freq(struct intel_rps *rps);
4244
int intel_rps_set_max_frequency(struct intel_rps *rps, u32 val);
4345
u32 intel_rps_get_rp0_frequency(struct intel_rps *rps);
4446
u32 intel_rps_get_rp1_frequency(struct intel_rps *rps);

0 commit comments

Comments
 (0)