Skip to content

Commit 6600f9d

Browse files
committed
Merge tag 'drm-intel-fixes-2020-11-19' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
- Fix tgl power gating issue (Rodrigo) - Memory leak fixes (Tvrtko, Chris) - Selftest fixes (Zhang) - Display bpc fix (Ville) - Fix TGL MOCS for PTE tracking (Chris) GVT Fixes: It temporarily disables VFIO edid feature on BXT/APL until its virtual display is really fixed to make it work properly. And fixes for DPCD 1.2 and error return in taking module reference. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20201119203417.GA1795798@intel.com
2 parents 9336127 + be33805 commit 6600f9d

11 files changed

Lines changed: 43 additions & 34 deletions

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12878,10 +12878,11 @@ compute_sink_pipe_bpp(const struct drm_connector_state *conn_state,
1287812878
case 10 ... 11:
1287912879
bpp = 10 * 3;
1288012880
break;
12881-
case 12:
12881+
case 12 ... 16:
1288212882
bpp = 12 * 3;
1288312883
break;
1288412884
default:
12885+
MISSING_CASE(conn_state->max_bpc);
1288512886
return -EINVAL;
1288612887
}
1288712888

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5457,6 +5457,7 @@ static void virtual_context_destroy(struct kref *kref)
54575457
__execlists_context_fini(&ve->context);
54585458
intel_context_fini(&ve->context);
54595459

5460+
intel_breadcrumbs_free(ve->base.breadcrumbs);
54605461
intel_engine_free_request_pool(&ve->base);
54615462

54625463
kfree(ve->bonds);

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,9 @@ static const struct drm_i915_mocs_entry tgl_mocs_table[] = {
243243
* only, __init_mocs_table() take care to program unused index with
244244
* this entry.
245245
*/
246-
MOCS_ENTRY(1, LE_3_WB | LE_TC_1_LLC | LE_LRUM(3),
247-
L3_3_WB),
246+
MOCS_ENTRY(I915_MOCS_PTE,
247+
LE_0_PAGETABLE | LE_TC_0_PAGETABLE,
248+
L3_1_UC),
248249
GEN11_MOCS_ENTRIES,
249250

250251
/* Implicitly enable L1 - HDC:L1 + L3 + LLC */

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

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,12 @@ static inline void set(struct intel_uncore *uncore, i915_reg_t reg, u32 val)
5656

5757
static void gen11_rc6_enable(struct intel_rc6 *rc6)
5858
{
59-
struct intel_uncore *uncore = rc6_to_uncore(rc6);
59+
struct intel_gt *gt = rc6_to_gt(rc6);
60+
struct intel_uncore *uncore = gt->uncore;
6061
struct intel_engine_cs *engine;
6162
enum intel_engine_id id;
63+
u32 pg_enable;
64+
int i;
6265

6366
/* 2b: Program RC6 thresholds.*/
6467
set(uncore, GEN6_RC6_WAKE_RATE_LIMIT, 54 << 16 | 85);
@@ -102,10 +105,19 @@ static void gen11_rc6_enable(struct intel_rc6 *rc6)
102105
GEN6_RC_CTL_RC6_ENABLE |
103106
GEN6_RC_CTL_EI_MODE(1);
104107

105-
set(uncore, GEN9_PG_ENABLE,
106-
GEN9_RENDER_PG_ENABLE |
107-
GEN9_MEDIA_PG_ENABLE |
108-
GEN11_MEDIA_SAMPLER_PG_ENABLE);
108+
pg_enable =
109+
GEN9_RENDER_PG_ENABLE |
110+
GEN9_MEDIA_PG_ENABLE |
111+
GEN11_MEDIA_SAMPLER_PG_ENABLE;
112+
113+
if (INTEL_GEN(gt->i915) >= 12) {
114+
for (i = 0; i < I915_MAX_VCS; i++)
115+
if (HAS_ENGINE(gt, _VCS(i)))
116+
pg_enable |= (VDN_HCP_POWERGATE_ENABLE(i) |
117+
VDN_MFX_POWERGATE_ENABLE(i));
118+
}
119+
120+
set(uncore, GEN9_PG_ENABLE, pg_enable);
109121
}
110122

111123
static void gen9_rc6_enable(struct intel_rc6 *rc6)

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,10 @@ static void _wa_add(struct i915_wa_list *wal, const struct i915_wa *wa)
131131
return;
132132
}
133133

134-
if (wal->list)
134+
if (wal->list) {
135135
memcpy(list, wal->list, sizeof(*wa) * wal->count);
136+
kfree(wal->list);
137+
}
136138

137139
wal->list = list;
138140
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ static unsigned char virtual_dp_monitor_edid[GVT_EDID_NUM][EDID_SIZE] = {
164164

165165
/* let the virtual display supports DP1.2 */
166166
static u8 dpcd_fix_data[DPCD_HEADER_SIZE] = {
167-
0x12, 0x014, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
167+
0x12, 0x014, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
168168
};
169169

170170
static void emulate_monitor_status_change(struct intel_vgpu *vgpu)

drivers/gpu/drm/i915/gvt/kvmgt.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,8 +829,10 @@ static int intel_vgpu_open(struct mdev_device *mdev)
829829
/* Take a module reference as mdev core doesn't take
830830
* a reference for vendor driver.
831831
*/
832-
if (!try_module_get(THIS_MODULE))
832+
if (!try_module_get(THIS_MODULE)) {
833+
ret = -ENODEV;
833834
goto undo_group;
835+
}
834836

835837
ret = kvmgt_guest_init(mdev);
836838
if (ret)

drivers/gpu/drm/i915/gvt/vgpu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,8 @@ static struct intel_vgpu *__intel_gvt_create_vgpu(struct intel_gvt *gvt,
439439

440440
if (IS_BROADWELL(dev_priv))
441441
ret = intel_gvt_hypervisor_set_edid(vgpu, PORT_B);
442-
else
442+
/* FixMe: Re-enable APL/BXT once vfio_edid enabled */
443+
else if (!IS_BROXTON(dev_priv))
443444
ret = intel_gvt_hypervisor_set_edid(vgpu, PORT_D);
444445
if (ret)
445446
goto out_clean_sched_policy;

drivers/gpu/drm/i915/i915_reg.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8971,10 +8971,6 @@ enum {
89718971
#define GEN9_PWRGT_MEDIA_STATUS_MASK (1 << 0)
89728972
#define GEN9_PWRGT_RENDER_STATUS_MASK (1 << 1)
89738973

8974-
#define POWERGATE_ENABLE _MMIO(0xa210)
8975-
#define VDN_HCP_POWERGATE_ENABLE(n) BIT(((n) * 2) + 3)
8976-
#define VDN_MFX_POWERGATE_ENABLE(n) BIT(((n) * 2) + 4)
8977-
89788974
#define GTFIFODBG _MMIO(0x120000)
89798975
#define GT_FIFO_SBDEDICATE_FREE_ENTRY_CHV (0x1f << 20)
89808976
#define GT_FIFO_FREE_ENTRIES_CHV (0x7f << 13)
@@ -9114,9 +9110,11 @@ enum {
91149110
#define GEN9_MEDIA_PG_IDLE_HYSTERESIS _MMIO(0xA0C4)
91159111
#define GEN9_RENDER_PG_IDLE_HYSTERESIS _MMIO(0xA0C8)
91169112
#define GEN9_PG_ENABLE _MMIO(0xA210)
9117-
#define GEN9_RENDER_PG_ENABLE REG_BIT(0)
9118-
#define GEN9_MEDIA_PG_ENABLE REG_BIT(1)
9119-
#define GEN11_MEDIA_SAMPLER_PG_ENABLE REG_BIT(2)
9113+
#define GEN9_RENDER_PG_ENABLE REG_BIT(0)
9114+
#define GEN9_MEDIA_PG_ENABLE REG_BIT(1)
9115+
#define GEN11_MEDIA_SAMPLER_PG_ENABLE REG_BIT(2)
9116+
#define VDN_HCP_POWERGATE_ENABLE(n) REG_BIT(3 + 2 * (n))
9117+
#define VDN_MFX_POWERGATE_ENABLE(n) REG_BIT(4 + 2 * (n))
91209118
#define GEN8_PUSHBUS_CONTROL _MMIO(0xA248)
91219119
#define GEN8_PUSHBUS_ENABLE _MMIO(0xA250)
91229120
#define GEN8_PUSHBUS_SHIFT _MMIO(0xA25C)

drivers/gpu/drm/i915/intel_pm.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7118,23 +7118,10 @@ static void icl_init_clock_gating(struct drm_i915_private *dev_priv)
71187118

71197119
static void tgl_init_clock_gating(struct drm_i915_private *dev_priv)
71207120
{
7121-
u32 vd_pg_enable = 0;
7122-
unsigned int i;
7123-
71247121
/* Wa_1409120013:tgl */
71257122
I915_WRITE(ILK_DPFC_CHICKEN,
71267123
ILK_DPFC_CHICKEN_COMP_DUMMY_PIXEL);
71277124

7128-
/* This is not a WA. Enable VD HCP & MFX_ENC powergate */
7129-
for (i = 0; i < I915_MAX_VCS; i++) {
7130-
if (HAS_ENGINE(&dev_priv->gt, _VCS(i)))
7131-
vd_pg_enable |= VDN_HCP_POWERGATE_ENABLE(i) |
7132-
VDN_MFX_POWERGATE_ENABLE(i);
7133-
}
7134-
7135-
I915_WRITE(POWERGATE_ENABLE,
7136-
I915_READ(POWERGATE_ENABLE) | vd_pg_enable);
7137-
71387125
/* Wa_1409825376:tgl (pre-prod)*/
71397126
if (IS_TGL_DISP_REVID(dev_priv, TGL_REVID_A0, TGL_REVID_B1))
71407127
I915_WRITE(GEN9_CLKGATE_DIS_3, I915_READ(GEN9_CLKGATE_DIS_3) |

0 commit comments

Comments
 (0)