Skip to content

Commit 5481e27

Browse files
committed
Merge tag 'drm-intel-next-2016-10-24' of git://anongit.freedesktop.org/drm-intel into drm-next
- first slice of the gvt device model (Zhenyu et al) - compression support for gpu error states (Chris) - sunset clause on gpu errors resulting in dmesg noise telling users how to report them - .rodata diet from Tvrtko - switch over lots of macros to only take dev_priv (Tvrtko) - underrun suppression for dp link training (Ville) - lspcon (hmdi 2.0 on skl/bxt) support from Shashank Sharma, polish from Jani - gen9 wm fixes from Paulo&Lyude - updated ddi programming for kbl (Rodrigo) - respect alternate aux/ddc pins (from vbt) for all ddi ports (Ville) * tag 'drm-intel-next-2016-10-24' of git://anongit.freedesktop.org/drm-intel: (227 commits) drm/i915: Update DRIVER_DATE to 20161024 drm/i915: Stop setting SNB min-freq-table 0 on powersave setup drm/i915/dp: add lane_count check in intel_dp_check_link_status drm/i915: Fix whitespace issues drm/i915: Clean up DDI DDC/AUX CH sanitation drm/i915: Respect alternate_ddc_pin for all DDI ports drm/i915: Respect alternate_aux_channel for all DDI ports drm/i915/gen9: Remove WaEnableYV12BugFixInHalfSliceChicken7 drm/i915: KBL - Recommended buffer translation programming for DisplayPort drm/i915: Move down skl/kbl ddi iboost and n_edp_entires fixup drm/i915: Add a sunset clause to GPU hang logging drm/i915: Stop reporting error details in dmesg as well as the error-state drm/i915/gvt: do not ignore return value of create_scratch_page drm/i915/gvt: fix spare warnings on odd constant _Bool cast drm/i915/gvt: mark symbols static where possible drm/i915/gvt: fix sparse warnings on different address spaces drm/i915/gvt: properly access enabled intel_engine_cs drm/i915/gvt: Remove defunct vmap_batch() drm/i915/gvt: Use common mapping routines for shadow_bb object drm/i915/gvt: Use common mapping routines for indirect_ctx object ...
2 parents 61d0a04 + 9558e74 commit 5481e27

File tree

109 files changed

+20193
-2948
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+20193
-2948
lines changed

Documentation/gpu/i915.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ Intel GVT-g Guest Support(vGPU)
4949
.. kernel-doc:: drivers/gpu/drm/i915/i915_vgpu.c
5050
:internal:
5151

52+
Intel GVT-g Host Support(vGPU device model)
53+
-------------------------------------------
54+
55+
.. kernel-doc:: drivers/gpu/drm/i915/intel_gvt.c
56+
:doc: Intel GVT-g host support
57+
58+
.. kernel-doc:: drivers/gpu/drm/i915/intel_gvt.c
59+
:internal:
60+
5261
Display Hardware Handling
5362
=========================
5463

MAINTAINERS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4064,6 +4064,16 @@ F: include/drm/i915*
40644064
F: include/uapi/drm/i915_drm.h
40654065
F: Documentation/gpu/i915.rst
40664066

4067+
INTEL GVT-g DRIVERS (Intel GPU Virtualization)
4068+
M: Zhenyu Wang <[email protected]>
4069+
M: Zhi Wang <[email protected]>
4070+
4071+
4072+
W: https://01.org/igvt-g
4073+
T: git https://github.com/01org/gvt-linux.git
4074+
S: Supported
4075+
F: drivers/gpu/drm/i915/gvt/
4076+
40674077
DRM DRIVERS FOR ATMEL HLCDC
40684078
M: Boris Brezillon <[email protected]>
40694079

drivers/gpu/drm/drm_dp_dual_mode_helper.c

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,14 @@ static bool is_type2_adaptor(uint8_t adaptor_id)
148148
DP_DUAL_MODE_REV_TYPE2);
149149
}
150150

151+
static bool is_lspcon_adaptor(const char hdmi_id[DP_DUAL_MODE_HDMI_ID_LEN],
152+
const uint8_t adaptor_id)
153+
{
154+
return is_hdmi_adaptor(hdmi_id) &&
155+
(adaptor_id == (DP_DUAL_MODE_TYPE_TYPE2 |
156+
DP_DUAL_MODE_TYPE_HAS_DPCD));
157+
}
158+
151159
/**
152160
* drm_dp_dual_mode_detect - Identify the DP dual mode adaptor
153161
* @adapter: I2C adapter for the DDC bus
@@ -203,6 +211,8 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter)
203211
ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_ADAPTOR_ID,
204212
&adaptor_id, sizeof(adaptor_id));
205213
if (ret == 0) {
214+
if (is_lspcon_adaptor(hdmi_id, adaptor_id))
215+
return DRM_DP_DUAL_MODE_LSPCON;
206216
if (is_type2_adaptor(adaptor_id)) {
207217
if (is_hdmi_adaptor(hdmi_id))
208218
return DRM_DP_DUAL_MODE_TYPE2_HDMI;
@@ -364,3 +374,96 @@ const char *drm_dp_get_dual_mode_type_name(enum drm_dp_dual_mode_type type)
364374
}
365375
}
366376
EXPORT_SYMBOL(drm_dp_get_dual_mode_type_name);
377+
378+
/**
379+
* drm_lspcon_get_mode: Get LSPCON's current mode of operation by
380+
* reading offset (0x80, 0x41)
381+
* @adapter: I2C-over-aux adapter
382+
* @mode: current lspcon mode of operation output variable
383+
*
384+
* Returns:
385+
* 0 on success, sets the current_mode value to appropriate mode
386+
* -error on failure
387+
*/
388+
int drm_lspcon_get_mode(struct i2c_adapter *adapter,
389+
enum drm_lspcon_mode *mode)
390+
{
391+
u8 data;
392+
int ret = 0;
393+
394+
if (!mode) {
395+
DRM_ERROR("NULL input\n");
396+
return -EINVAL;
397+
}
398+
399+
/* Read Status: i2c over aux */
400+
ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_LSPCON_CURRENT_MODE,
401+
&data, sizeof(data));
402+
if (ret < 0) {
403+
DRM_ERROR("LSPCON read(0x80, 0x41) failed\n");
404+
return -EFAULT;
405+
}
406+
407+
if (data & DP_DUAL_MODE_LSPCON_MODE_PCON)
408+
*mode = DRM_LSPCON_MODE_PCON;
409+
else
410+
*mode = DRM_LSPCON_MODE_LS;
411+
return 0;
412+
}
413+
EXPORT_SYMBOL(drm_lspcon_get_mode);
414+
415+
/**
416+
* drm_lspcon_set_mode: Change LSPCON's mode of operation by
417+
* writing offset (0x80, 0x40)
418+
* @adapter: I2C-over-aux adapter
419+
* @mode: required mode of operation
420+
*
421+
* Returns:
422+
* 0 on success, -error on failure/timeout
423+
*/
424+
int drm_lspcon_set_mode(struct i2c_adapter *adapter,
425+
enum drm_lspcon_mode mode)
426+
{
427+
u8 data = 0;
428+
int ret;
429+
int time_out = 200;
430+
enum drm_lspcon_mode current_mode;
431+
432+
if (mode == DRM_LSPCON_MODE_PCON)
433+
data = DP_DUAL_MODE_LSPCON_MODE_PCON;
434+
435+
/* Change mode */
436+
ret = drm_dp_dual_mode_write(adapter, DP_DUAL_MODE_LSPCON_MODE_CHANGE,
437+
&data, sizeof(data));
438+
if (ret < 0) {
439+
DRM_ERROR("LSPCON mode change failed\n");
440+
return ret;
441+
}
442+
443+
/*
444+
* Confirm mode change by reading the status bit.
445+
* Sometimes, it takes a while to change the mode,
446+
* so wait and retry until time out or done.
447+
*/
448+
do {
449+
ret = drm_lspcon_get_mode(adapter, &current_mode);
450+
if (ret) {
451+
DRM_ERROR("can't confirm LSPCON mode change\n");
452+
return ret;
453+
} else {
454+
if (current_mode != mode) {
455+
msleep(10);
456+
time_out -= 10;
457+
} else {
458+
DRM_DEBUG_KMS("LSPCON mode changed to %s\n",
459+
mode == DRM_LSPCON_MODE_LS ?
460+
"LS" : "PCON");
461+
return 0;
462+
}
463+
}
464+
} while (time_out);
465+
466+
DRM_ERROR("LSPCON mode change timed out\n");
467+
return -ETIMEDOUT;
468+
}
469+
EXPORT_SYMBOL(drm_lspcon_set_mode);

drivers/gpu/drm/i915/Kconfig

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,31 @@ config DRM_I915_PRELIMINARY_HW_SUPPORT
4646

4747
If in doubt, say "N".
4848

49+
config DRM_I915_CAPTURE_ERROR
50+
bool "Enable capturing GPU state following a hang"
51+
depends on DRM_I915
52+
default y
53+
help
54+
This option enables capturing the GPU state when a hang is detected.
55+
This information is vital for triaging hangs and assists in debugging.
56+
Please report any hang to
57+
https://bugs.freedesktop.org/enter_bug.cgi?product=DRI
58+
for triaging.
59+
60+
If in doubt, say "Y".
61+
62+
config DRM_I915_COMPRESS_ERROR
63+
bool "Compress GPU error state"
64+
depends on DRM_I915_CAPTURE_ERROR
65+
select ZLIB_DEFLATE
66+
default y
67+
help
68+
This option selects ZLIB_DEFLATE if it isn't already
69+
selected and causes any error state captured upon a GPU hang
70+
to be compressed using zlib.
71+
72+
If in doubt, say "Y".
73+
4974
config DRM_I915_USERPTR
5075
bool "Always enable userptr support"
5176
depends on DRM_I915

drivers/gpu/drm/i915/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ i915-y += i915_cmd_parser.o \
4242
i915_gem_stolen.o \
4343
i915_gem_tiling.o \
4444
i915_gem_userptr.o \
45-
i915_gpu_error.o \
4645
i915_trace_points.o \
4746
intel_breadcrumbs.o \
4847
intel_engine_cs.o \
@@ -102,11 +101,15 @@ i915-y += dvo_ch7017.o \
102101
intel_dvo.o \
103102
intel_hdmi.o \
104103
intel_i2c.o \
104+
intel_lspcon.o \
105105
intel_lvds.o \
106106
intel_panel.o \
107107
intel_sdvo.o \
108108
intel_tv.o
109109

110+
# Post-mortem debug and GPU hang state capture
111+
i915-$(CONFIG_DRM_I915_CAPTURE_ERROR) += i915_gpu_error.o
112+
110113
# virtual gpu code
111114
i915-y += i915_vgpu.o
112115

drivers/gpu/drm/i915/gvt/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
GVT_DIR := gvt
2-
GVT_SOURCE := gvt.o
2+
GVT_SOURCE := gvt.o aperture_gm.o handlers.o vgpu.o trace_points.o firmware.o \
3+
interrupt.o gtt.o cfg_space.o opregion.o mmio.o display.o edid.o \
4+
execlist.o scheduler.o sched_policy.o render.o cmd_parser.o
35

46
ccflags-y += -I$(src) -I$(src)/$(GVT_DIR) -Wall
57
i915-y += $(addprefix $(GVT_DIR)/, $(GVT_SOURCE))

0 commit comments

Comments
 (0)