Skip to content

Commit

Permalink
Merge tag 'drm-intel-next-fixes-2016-07-25' of git://anongit.freedesk…
Browse files Browse the repository at this point in the history
…top.org/drm-intel into drm-next

Bunch of fixes for the 4.8 merge pull, nothing out of the ordinary. All
suitably marked up with cc: stable where needed.

* tag 'drm-intel-next-fixes-2016-07-25' of git://anongit.freedesktop.org/drm-intel:
  drm/i915/gen9: Add WaInPlaceDecompressionHang
  drm/i915/guc: Revert "drm/i915/guc: enable GuC loading & submission by default"
  drm/i915/bxt: Fix inadvertent CPU snooping due to incorrect MOCS config
  drm/i915/gen9: Clean up MOCS table definitions
  drm/i915: Set legacy properties when using legacy gamma set IOCTL. (v2)
  drm/i915: Enable polling when we don't have hpd
  drm/i915/vlv: Disable HPD in valleyview_crt_detect_hotplug()
  drm/i915/vlv: Reset the ADPA in vlv_display_power_well_init()
  drm/i915/vlv: Make intel_crt_reset() per-encoder
  drm/i915: Unbreak interrupts on pre-gen6
  drm/i915/breadcrumbs: Queue hangcheck before sleeping
  • Loading branch information
airlied committed Jul 27, 2016
2 parents 9af07af + f15f6ca commit c3f8d86
Show file tree
Hide file tree
Showing 13 changed files with 286 additions and 60 deletions.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/i915/i915_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -2413,6 +2413,9 @@ static int intel_runtime_suspend(struct device *device)

assert_forcewakes_inactive(dev_priv);

if (!IS_VALLEYVIEW(dev_priv) || !IS_CHERRYVIEW(dev_priv))
intel_hpd_poll_init(dev_priv);

DRM_DEBUG_KMS("Device suspended\n");
return 0;
}
Expand Down
7 changes: 7 additions & 0 deletions drivers/gpu/drm/i915/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@ struct i915_hotplug {
u32 short_port_mask;
struct work_struct dig_port_work;

struct work_struct poll_init_work;
bool poll_enabled;

/*
* if we get a HPD irq from DP and a HPD irq from non-DP
* the non-DP HPD could block the workqueue on a mode config
Expand Down Expand Up @@ -2743,6 +2746,8 @@ struct drm_i915_cmd_table {
#define SKL_REVID_D0 0x3
#define SKL_REVID_E0 0x4
#define SKL_REVID_F0 0x5
#define SKL_REVID_G0 0x6
#define SKL_REVID_H0 0x7

#define IS_SKL_REVID(p, since, until) (IS_SKYLAKE(p) && IS_REVID(p, since, until))

Expand Down Expand Up @@ -2957,6 +2962,8 @@ void intel_hpd_init(struct drm_i915_private *dev_priv);
void intel_hpd_init_work(struct drm_i915_private *dev_priv);
void intel_hpd_cancel_work(struct drm_i915_private *dev_priv);
bool intel_hpd_pin_to_port(enum hpd_pin pin, enum port *port);
bool intel_hpd_disable(struct drm_i915_private *dev_priv, enum hpd_pin pin);
void intel_hpd_enable(struct drm_i915_private *dev_priv, enum hpd_pin pin);

/* i915_irq.c */
static inline void i915_queue_hangcheck(struct drm_i915_private *dev_priv)
Expand Down
9 changes: 0 additions & 9 deletions drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1501,15 +1501,6 @@ int __i915_wait_request(struct drm_i915_gem_request *req,
break;
}

/* Ensure that even if the GPU hangs, we get woken up.
*
* However, note that if no one is waiting, we never notice
* a gpu hang. Eventually, we will have to wait for a resource
* held by the GPU and so trigger a hangcheck. In the most
* pathological case, this will be upon memory starvation!
*/
i915_queue_hangcheck(req->i915);

timeout_remain = io_schedule_timeout(timeout_remain);
if (timeout_remain == 0) {
ret = -ETIME;
Expand Down
8 changes: 4 additions & 4 deletions drivers/gpu/drm/i915/i915_params.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ struct i915_params i915 __read_mostly = {
.verbose_state_checks = 1,
.nuclear_pageflip = 0,
.edp_vswing = 0,
.enable_guc_loading = -1,
.enable_guc_submission = -1,
.enable_guc_loading = 0,
.enable_guc_submission = 0,
.guc_log_level = -1,
.enable_dp_mst = true,
.inject_load_failure = 0,
Expand Down Expand Up @@ -203,12 +203,12 @@ MODULE_PARM_DESC(edp_vswing,
module_param_named_unsafe(enable_guc_loading, i915.enable_guc_loading, int, 0400);
MODULE_PARM_DESC(enable_guc_loading,
"Enable GuC firmware loading "
"(-1=auto [default], 0=never, 1=if available, 2=required)");
"(-1=auto, 0=never [default], 1=if available, 2=required)");

module_param_named_unsafe(enable_guc_submission, i915.enable_guc_submission, int, 0400);
MODULE_PARM_DESC(enable_guc_submission,
"Enable GuC submission "
"(-1=auto [default], 0=never, 1=if available, 2=required)");
"(-1=auto, 0=never [default], 1=if available, 2=required)");

module_param_named(guc_log_level, i915.guc_log_level, int, 0400);
MODULE_PARM_DESC(guc_log_level,
Expand Down
3 changes: 3 additions & 0 deletions drivers/gpu/drm/i915/i915_reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -1686,6 +1686,9 @@ enum skl_disp_power_wells {

#define GEN7_TLB_RD_ADDR _MMIO(0x4700)

#define GEN9_GAMT_ECO_REG_RW_IA _MMIO(0x4ab0)
#define GAMT_ECO_ENABLE_IN_PLACE_DECOMPRESS (1<<18)

#define GAMT_CHKN_BIT_REG _MMIO(0x4ab8)
#define GAMT_CHKN_DISABLE_DYNAMIC_CREDIT_SHARING (1<<28)

Expand Down
9 changes: 9 additions & 0 deletions drivers/gpu/drm/i915/intel_breadcrumbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ static void __intel_breadcrumbs_enable_irq(struct intel_breadcrumbs *b)
if (!b->irq_enabled ||
test_bit(engine->id, &i915->gpu_error.missed_irq_rings))
mod_timer(&b->fake_irq, jiffies + 1);

/* Ensure that even if the GPU hangs, we get woken up.
*
* However, note that if no one is waiting, we never notice
* a gpu hang. Eventually, we will have to wait for a resource
* held by the GPU and so trigger a hangcheck. In the most
* pathological case, this will be upon memory starvation!
*/
i915_queue_hangcheck(i915);
}

static void __intel_breadcrumbs_disable_irq(struct intel_breadcrumbs *b)
Expand Down
28 changes: 23 additions & 5 deletions drivers/gpu/drm/i915/intel_crt.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,25 @@ static bool valleyview_crt_detect_hotplug(struct drm_connector *connector)
struct drm_device *dev = connector->dev;
struct intel_crt *crt = intel_attached_crt(connector);
struct drm_i915_private *dev_priv = to_i915(dev);
bool reenable_hpd;
u32 adpa;
bool ret;
u32 save_adpa;

/*
* Doing a force trigger causes a hpd interrupt to get sent, which can
* get us stuck in a loop if we're polling:
* - We enable power wells and reset the ADPA
* - output_poll_exec does force probe on VGA, triggering a hpd
* - HPD handler waits for poll to unlock dev->mode_config.mutex
* - output_poll_exec shuts off the ADPA, unlocks
* dev->mode_config.mutex
* - HPD handler runs, resets ADPA and brings us back to the start
*
* Just disable HPD interrupts here to prevent this
*/
reenable_hpd = intel_hpd_disable(dev_priv, crt->base.hpd_pin);

save_adpa = adpa = I915_READ(crt->adpa_reg);
DRM_DEBUG_KMS("trigger hotplug detect cycle: adpa=0x%x\n", adpa);

Expand All @@ -357,6 +372,9 @@ static bool valleyview_crt_detect_hotplug(struct drm_connector *connector)

DRM_DEBUG_KMS("valleyview hotplug adpa=0x%x, result %d\n", adpa, ret);

if (reenable_hpd)
intel_hpd_enable(dev_priv, crt->base.hpd_pin);

return ret;
}

Expand Down Expand Up @@ -717,11 +735,11 @@ static int intel_crt_set_property(struct drm_connector *connector,
return 0;
}

static void intel_crt_reset(struct drm_connector *connector)
void intel_crt_reset(struct drm_encoder *encoder)
{
struct drm_device *dev = connector->dev;
struct drm_device *dev = encoder->dev;
struct drm_i915_private *dev_priv = to_i915(dev);
struct intel_crt *crt = intel_attached_crt(connector);
struct intel_crt *crt = intel_encoder_to_crt(to_intel_encoder(encoder));

if (INTEL_INFO(dev)->gen >= 5) {
u32 adpa;
Expand All @@ -743,7 +761,6 @@ static void intel_crt_reset(struct drm_connector *connector)
*/

static const struct drm_connector_funcs intel_crt_connector_funcs = {
.reset = intel_crt_reset,
.dpms = drm_atomic_helper_connector_dpms,
.detect = intel_crt_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
Expand All @@ -762,6 +779,7 @@ static const struct drm_connector_helper_funcs intel_crt_connector_helper_funcs
};

static const struct drm_encoder_funcs intel_crt_enc_funcs = {
.reset = intel_crt_reset,
.destroy = intel_encoder_destroy,
};

Expand Down Expand Up @@ -904,5 +922,5 @@ void intel_crt_init(struct drm_device *dev)
dev_priv->fdi_rx_config = I915_READ(FDI_RX_CTL(PIPE_A)) & fdi_config;
}

intel_crt_reset(connector);
intel_crt_reset(&crt->base.base);
}
44 changes: 43 additions & 1 deletion drivers/gpu/drm/i915/intel_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -13924,8 +13924,50 @@ void intel_crtc_restore_mode(struct drm_crtc *crtc)

#undef for_each_intel_crtc_masked

/*
* FIXME: Remove this once i915 is fully DRIVER_ATOMIC by calling
* drm_atomic_helper_legacy_gamma_set() directly.
*/
static int intel_atomic_legacy_gamma_set(struct drm_crtc *crtc,
u16 *red, u16 *green, u16 *blue,
uint32_t size)
{
struct drm_device *dev = crtc->dev;
struct drm_mode_config *config = &dev->mode_config;
struct drm_crtc_state *state;
int ret;

ret = drm_atomic_helper_legacy_gamma_set(crtc, red, green, blue, size);
if (ret)
return ret;

/*
* Make sure we update the legacy properties so this works when
* atomic is not enabled.
*/

state = crtc->state;

drm_object_property_set_value(&crtc->base,
config->degamma_lut_property,
(state->degamma_lut) ?
state->degamma_lut->base.id : 0);

drm_object_property_set_value(&crtc->base,
config->ctm_property,
(state->ctm) ?
state->ctm->base.id : 0);

drm_object_property_set_value(&crtc->base,
config->gamma_lut_property,
(state->gamma_lut) ?
state->gamma_lut->base.id : 0);

return 0;
}

static const struct drm_crtc_funcs intel_crtc_funcs = {
.gamma_set = drm_atomic_helper_legacy_gamma_set,
.gamma_set = intel_atomic_legacy_gamma_set,
.set_config = drm_atomic_helper_set_config,
.set_property = drm_atomic_helper_crtc_set_property,
.destroy = intel_crtc_destroy,
Expand Down
4 changes: 3 additions & 1 deletion drivers/gpu/drm/i915/intel_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ void gen8_irq_power_well_pre_disable(struct drm_i915_private *dev_priv,

/* intel_crt.c */
void intel_crt_init(struct drm_device *dev);

void intel_crt_reset(struct drm_encoder *encoder);

/* intel_ddi.c */
void intel_ddi_clk_select(struct intel_encoder *encoder,
Expand Down Expand Up @@ -1425,6 +1425,8 @@ int intel_dsi_dcs_init_backlight_funcs(struct intel_connector *intel_connector);

/* intel_dvo.c */
void intel_dvo_init(struct drm_device *dev);
/* intel_hotplug.c */
void intel_hpd_poll_init(struct drm_i915_private *dev_priv);


/* legacy fbdev emulation in intel_fbdev.c */
Expand Down
Loading

0 comments on commit c3f8d86

Please sign in to comment.