Commit 2d591ab1 authored by Dave Airlie's avatar Dave Airlie

Merge tag 'drm-intel-fixes-2015-11-19' of git://anongit.freedesktop.org/drm-intel into drm-fixes

i915 fixes for 4.4, including the revert for the backlight regression
Olof reported. Otherwise fixes all around.

* tag 'drm-intel-fixes-2015-11-19' of git://anongit.freedesktop.org/drm-intel:
  Revert "drm/i915: skip modeset if compatible for everyone."
  drm/i915: Consider SPLL as another shared pll, v2.
  drm/i915: Fix gpu frequency change tracing
  drm/i915: Don't clobber the addfb2 ioctl params
  drm/i915: Clear intel_crtc->atomic before updating it.
  drm/i915: get runtime PM reference around GEM set_caching IOCTL
  drm/i915: Fix GT frequency rounding
  drm/i915: quirk backlight present on Macbook 4, 1
  drm/i915: Fix crtc_y assignment in intel_find_initial_plane_obj()
parents db395637 73831236
...@@ -351,6 +351,8 @@ enum intel_dpll_id { ...@@ -351,6 +351,8 @@ enum intel_dpll_id {
/* hsw/bdw */ /* hsw/bdw */
DPLL_ID_WRPLL1 = 0, DPLL_ID_WRPLL1 = 0,
DPLL_ID_WRPLL2 = 1, DPLL_ID_WRPLL2 = 1,
DPLL_ID_SPLL = 2,
/* skl */ /* skl */
DPLL_ID_SKL_DPLL1 = 0, DPLL_ID_SKL_DPLL1 = 0,
DPLL_ID_SKL_DPLL2 = 1, DPLL_ID_SKL_DPLL2 = 1,
...@@ -367,6 +369,7 @@ struct intel_dpll_hw_state { ...@@ -367,6 +369,7 @@ struct intel_dpll_hw_state {
/* hsw, bdw */ /* hsw, bdw */
uint32_t wrpll; uint32_t wrpll;
uint32_t spll;
/* skl */ /* skl */
/* /*
...@@ -2648,6 +2651,7 @@ struct i915_params { ...@@ -2648,6 +2651,7 @@ struct i915_params {
int enable_cmd_parser; int enable_cmd_parser;
/* leave bools at the end to not create holes */ /* leave bools at the end to not create holes */
bool enable_hangcheck; bool enable_hangcheck;
bool fastboot;
bool prefault_disable; bool prefault_disable;
bool load_detect_test; bool load_detect_test;
bool reset; bool reset;
......
...@@ -3809,6 +3809,7 @@ int i915_gem_get_caching_ioctl(struct drm_device *dev, void *data, ...@@ -3809,6 +3809,7 @@ int i915_gem_get_caching_ioctl(struct drm_device *dev, void *data,
int i915_gem_set_caching_ioctl(struct drm_device *dev, void *data, int i915_gem_set_caching_ioctl(struct drm_device *dev, void *data,
struct drm_file *file) struct drm_file *file)
{ {
struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_i915_gem_caching *args = data; struct drm_i915_gem_caching *args = data;
struct drm_i915_gem_object *obj; struct drm_i915_gem_object *obj;
enum i915_cache_level level; enum i915_cache_level level;
...@@ -3837,9 +3838,11 @@ int i915_gem_set_caching_ioctl(struct drm_device *dev, void *data, ...@@ -3837,9 +3838,11 @@ int i915_gem_set_caching_ioctl(struct drm_device *dev, void *data,
return -EINVAL; return -EINVAL;
} }
intel_runtime_pm_get(dev_priv);
ret = i915_mutex_lock_interruptible(dev); ret = i915_mutex_lock_interruptible(dev);
if (ret) if (ret)
return ret; goto rpm_put;
obj = to_intel_bo(drm_gem_object_lookup(dev, file, args->handle)); obj = to_intel_bo(drm_gem_object_lookup(dev, file, args->handle));
if (&obj->base == NULL) { if (&obj->base == NULL) {
...@@ -3852,6 +3855,9 @@ int i915_gem_set_caching_ioctl(struct drm_device *dev, void *data, ...@@ -3852,6 +3855,9 @@ int i915_gem_set_caching_ioctl(struct drm_device *dev, void *data,
drm_gem_object_unreference(&obj->base); drm_gem_object_unreference(&obj->base);
unlock: unlock:
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
rpm_put:
intel_runtime_pm_put(dev_priv);
return ret; return ret;
} }
......
...@@ -40,6 +40,7 @@ struct i915_params i915 __read_mostly = { ...@@ -40,6 +40,7 @@ struct i915_params i915 __read_mostly = {
.preliminary_hw_support = IS_ENABLED(CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT), .preliminary_hw_support = IS_ENABLED(CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT),
.disable_power_well = -1, .disable_power_well = -1,
.enable_ips = 1, .enable_ips = 1,
.fastboot = 0,
.prefault_disable = 0, .prefault_disable = 0,
.load_detect_test = 0, .load_detect_test = 0,
.reset = true, .reset = true,
...@@ -133,6 +134,10 @@ MODULE_PARM_DESC(disable_power_well, ...@@ -133,6 +134,10 @@ MODULE_PARM_DESC(disable_power_well,
module_param_named_unsafe(enable_ips, i915.enable_ips, int, 0600); module_param_named_unsafe(enable_ips, i915.enable_ips, int, 0600);
MODULE_PARM_DESC(enable_ips, "Enable IPS (default: true)"); MODULE_PARM_DESC(enable_ips, "Enable IPS (default: true)");
module_param_named(fastboot, i915.fastboot, bool, 0600);
MODULE_PARM_DESC(fastboot,
"Try to skip unnecessary mode sets at boot time (default: false)");
module_param_named_unsafe(prefault_disable, i915.prefault_disable, bool, 0600); module_param_named_unsafe(prefault_disable, i915.prefault_disable, bool, 0600);
MODULE_PARM_DESC(prefault_disable, MODULE_PARM_DESC(prefault_disable,
"Disable page prefaulting for pread/pwrite/reloc (default:false). " "Disable page prefaulting for pread/pwrite/reloc (default:false). "
......
...@@ -138,18 +138,6 @@ static void hsw_crt_get_config(struct intel_encoder *encoder, ...@@ -138,18 +138,6 @@ static void hsw_crt_get_config(struct intel_encoder *encoder,
pipe_config->base.adjusted_mode.flags |= intel_crt_get_flags(encoder); pipe_config->base.adjusted_mode.flags |= intel_crt_get_flags(encoder);
} }
static void hsw_crt_pre_enable(struct intel_encoder *encoder)
{
struct drm_device *dev = encoder->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
WARN(I915_READ(SPLL_CTL) & SPLL_PLL_ENABLE, "SPLL already enabled\n");
I915_WRITE(SPLL_CTL,
SPLL_PLL_ENABLE | SPLL_PLL_FREQ_1350MHz | SPLL_PLL_SSC);
POSTING_READ(SPLL_CTL);
udelay(20);
}
/* Note: The caller is required to filter out dpms modes not supported by the /* Note: The caller is required to filter out dpms modes not supported by the
* platform. */ * platform. */
static void intel_crt_set_dpms(struct intel_encoder *encoder, int mode) static void intel_crt_set_dpms(struct intel_encoder *encoder, int mode)
...@@ -216,19 +204,6 @@ static void pch_post_disable_crt(struct intel_encoder *encoder) ...@@ -216,19 +204,6 @@ static void pch_post_disable_crt(struct intel_encoder *encoder)
intel_disable_crt(encoder); intel_disable_crt(encoder);
} }
static void hsw_crt_post_disable(struct intel_encoder *encoder)
{
struct drm_device *dev = encoder->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
uint32_t val;
DRM_DEBUG_KMS("Disabling SPLL\n");
val = I915_READ(SPLL_CTL);
WARN_ON(!(val & SPLL_PLL_ENABLE));
I915_WRITE(SPLL_CTL, val & ~SPLL_PLL_ENABLE);
POSTING_READ(SPLL_CTL);
}
static void intel_enable_crt(struct intel_encoder *encoder) static void intel_enable_crt(struct intel_encoder *encoder)
{ {
struct intel_crt *crt = intel_encoder_to_crt(encoder); struct intel_crt *crt = intel_encoder_to_crt(encoder);
...@@ -280,6 +255,10 @@ static bool intel_crt_compute_config(struct intel_encoder *encoder, ...@@ -280,6 +255,10 @@ static bool intel_crt_compute_config(struct intel_encoder *encoder,
if (HAS_DDI(dev)) { if (HAS_DDI(dev)) {
pipe_config->ddi_pll_sel = PORT_CLK_SEL_SPLL; pipe_config->ddi_pll_sel = PORT_CLK_SEL_SPLL;
pipe_config->port_clock = 135000 * 2; pipe_config->port_clock = 135000 * 2;
pipe_config->dpll_hw_state.wrpll = 0;
pipe_config->dpll_hw_state.spll =
SPLL_PLL_ENABLE | SPLL_PLL_FREQ_1350MHz | SPLL_PLL_SSC;
} }
return true; return true;
...@@ -860,8 +839,6 @@ void intel_crt_init(struct drm_device *dev) ...@@ -860,8 +839,6 @@ void intel_crt_init(struct drm_device *dev)
if (HAS_DDI(dev)) { if (HAS_DDI(dev)) {
crt->base.get_config = hsw_crt_get_config; crt->base.get_config = hsw_crt_get_config;
crt->base.get_hw_state = intel_ddi_get_hw_state; crt->base.get_hw_state = intel_ddi_get_hw_state;
crt->base.pre_enable = hsw_crt_pre_enable;
crt->base.post_disable = hsw_crt_post_disable;
} else { } else {
crt->base.get_config = intel_crt_get_config; crt->base.get_config = intel_crt_get_config;
crt->base.get_hw_state = intel_crt_get_hw_state; crt->base.get_hw_state = intel_crt_get_hw_state;
......
...@@ -1286,6 +1286,18 @@ hsw_ddi_pll_select(struct intel_crtc *intel_crtc, ...@@ -1286,6 +1286,18 @@ hsw_ddi_pll_select(struct intel_crtc *intel_crtc,
} }
crtc_state->ddi_pll_sel = PORT_CLK_SEL_WRPLL(pll->id); crtc_state->ddi_pll_sel = PORT_CLK_SEL_WRPLL(pll->id);
} else if (crtc_state->ddi_pll_sel == PORT_CLK_SEL_SPLL) {
struct drm_atomic_state *state = crtc_state->base.state;
struct intel_shared_dpll_config *spll =
&intel_atomic_get_shared_dpll_state(state)[DPLL_ID_SPLL];
if (spll->crtc_mask &&
WARN_ON(spll->hw_state.spll != crtc_state->dpll_hw_state.spll))
return false;
crtc_state->shared_dpll = DPLL_ID_SPLL;
spll->hw_state.spll = crtc_state->dpll_hw_state.spll;
spll->crtc_mask |= 1 << intel_crtc->pipe;
} }
return true; return true;
...@@ -2437,7 +2449,7 @@ static void intel_disable_ddi(struct intel_encoder *intel_encoder) ...@@ -2437,7 +2449,7 @@ static void intel_disable_ddi(struct intel_encoder *intel_encoder)
} }
} }
static void hsw_ddi_pll_enable(struct drm_i915_private *dev_priv, static void hsw_ddi_wrpll_enable(struct drm_i915_private *dev_priv,
struct intel_shared_dpll *pll) struct intel_shared_dpll *pll)
{ {
I915_WRITE(WRPLL_CTL(pll->id), pll->config.hw_state.wrpll); I915_WRITE(WRPLL_CTL(pll->id), pll->config.hw_state.wrpll);
...@@ -2445,8 +2457,16 @@ static void hsw_ddi_pll_enable(struct drm_i915_private *dev_priv, ...@@ -2445,8 +2457,16 @@ static void hsw_ddi_pll_enable(struct drm_i915_private *dev_priv,
udelay(20); udelay(20);
} }
static void hsw_ddi_pll_disable(struct drm_i915_private *dev_priv, static void hsw_ddi_spll_enable(struct drm_i915_private *dev_priv,
struct intel_shared_dpll *pll) struct intel_shared_dpll *pll)
{
I915_WRITE(SPLL_CTL, pll->config.hw_state.spll);
POSTING_READ(SPLL_CTL);
udelay(20);
}
static void hsw_ddi_wrpll_disable(struct drm_i915_private *dev_priv,
struct intel_shared_dpll *pll)
{ {
uint32_t val; uint32_t val;
...@@ -2455,9 +2475,19 @@ static void hsw_ddi_pll_disable(struct drm_i915_private *dev_priv, ...@@ -2455,9 +2475,19 @@ static void hsw_ddi_pll_disable(struct drm_i915_private *dev_priv,
POSTING_READ(WRPLL_CTL(pll->id)); POSTING_READ(WRPLL_CTL(pll->id));
} }
static bool hsw_ddi_pll_get_hw_state(struct drm_i915_private *dev_priv, static void hsw_ddi_spll_disable(struct drm_i915_private *dev_priv,
struct intel_shared_dpll *pll, struct intel_shared_dpll *pll)
struct intel_dpll_hw_state *hw_state) {
uint32_t val;
val = I915_READ(SPLL_CTL);
I915_WRITE(SPLL_CTL, val & ~SPLL_PLL_ENABLE);
POSTING_READ(SPLL_CTL);
}
static bool hsw_ddi_wrpll_get_hw_state(struct drm_i915_private *dev_priv,
struct intel_shared_dpll *pll,
struct intel_dpll_hw_state *hw_state)
{ {
uint32_t val; uint32_t val;
...@@ -2470,25 +2500,50 @@ static bool hsw_ddi_pll_get_hw_state(struct drm_i915_private *dev_priv, ...@@ -2470,25 +2500,50 @@ static bool hsw_ddi_pll_get_hw_state(struct drm_i915_private *dev_priv,
return val & WRPLL_PLL_ENABLE; return val & WRPLL_PLL_ENABLE;
} }
static bool hsw_ddi_spll_get_hw_state(struct drm_i915_private *dev_priv,
struct intel_shared_dpll *pll,
struct intel_dpll_hw_state *hw_state)
{
uint32_t val;
if (!intel_display_power_is_enabled(dev_priv, POWER_DOMAIN_PLLS))
return false;
val = I915_READ(SPLL_CTL);
hw_state->spll = val;
return val & SPLL_PLL_ENABLE;
}
static const char * const hsw_ddi_pll_names[] = { static const char * const hsw_ddi_pll_names[] = {
"WRPLL 1", "WRPLL 1",
"WRPLL 2", "WRPLL 2",
"SPLL"
}; };
static void hsw_shared_dplls_init(struct drm_i915_private *dev_priv) static void hsw_shared_dplls_init(struct drm_i915_private *dev_priv)
{ {
int i; int i;
dev_priv->num_shared_dpll = 2; dev_priv->num_shared_dpll = 3;
for (i = 0; i < dev_priv->num_shared_dpll; i++) { for (i = 0; i < 2; i++) {
dev_priv->shared_dplls[i].id = i; dev_priv->shared_dplls[i].id = i;
dev_priv->shared_dplls[i].name = hsw_ddi_pll_names[i]; dev_priv->shared_dplls[i].name = hsw_ddi_pll_names[i];
dev_priv->shared_dplls[i].disable = hsw_ddi_pll_disable; dev_priv->shared_dplls[i].disable = hsw_ddi_wrpll_disable;
dev_priv->shared_dplls[i].enable = hsw_ddi_pll_enable; dev_priv->shared_dplls[i].enable = hsw_ddi_wrpll_enable;
dev_priv->shared_dplls[i].get_hw_state = dev_priv->shared_dplls[i].get_hw_state =
hsw_ddi_pll_get_hw_state; hsw_ddi_wrpll_get_hw_state;
} }
/* SPLL is special, but needs to be initialized anyway.. */
dev_priv->shared_dplls[i].id = i;
dev_priv->shared_dplls[i].name = hsw_ddi_pll_names[i];
dev_priv->shared_dplls[i].disable = hsw_ddi_spll_disable;
dev_priv->shared_dplls[i].enable = hsw_ddi_spll_enable;
dev_priv->shared_dplls[i].get_hw_state = hsw_ddi_spll_get_hw_state;
} }
static const char * const skl_ddi_pll_names[] = { static const char * const skl_ddi_pll_names[] = {
......
...@@ -2646,11 +2646,13 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc, ...@@ -2646,11 +2646,13 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
return; return;
valid_fb: valid_fb:
plane_state->src_x = plane_state->src_y = 0; plane_state->src_x = 0;
plane_state->src_y = 0;
plane_state->src_w = fb->width << 16; plane_state->src_w = fb->width << 16;
plane_state->src_h = fb->height << 16; plane_state->src_h = fb->height << 16;
plane_state->crtc_x = plane_state->src_y = 0; plane_state->crtc_x = 0;
plane_state->crtc_y = 0;
plane_state->crtc_w = fb->width; plane_state->crtc_w = fb->width;
plane_state->crtc_h = fb->height; plane_state->crtc_h = fb->height;
...@@ -4237,6 +4239,7 @@ struct intel_shared_dpll *intel_get_shared_dpll(struct intel_crtc *crtc, ...@@ -4237,6 +4239,7 @@ struct intel_shared_dpll *intel_get_shared_dpll(struct intel_crtc *crtc,
struct intel_shared_dpll *pll; struct intel_shared_dpll *pll;
struct intel_shared_dpll_config *shared_dpll; struct intel_shared_dpll_config *shared_dpll;
enum intel_dpll_id i; enum intel_dpll_id i;
int max = dev_priv->num_shared_dpll;
shared_dpll = intel_atomic_get_shared_dpll_state(crtc_state->base.state); shared_dpll = intel_atomic_get_shared_dpll_state(crtc_state->base.state);
...@@ -4271,9 +4274,11 @@ struct intel_shared_dpll *intel_get_shared_dpll(struct intel_crtc *crtc, ...@@ -4271,9 +4274,11 @@ struct intel_shared_dpll *intel_get_shared_dpll(struct intel_crtc *crtc,
WARN_ON(shared_dpll[i].crtc_mask); WARN_ON(shared_dpll[i].crtc_mask);
goto found; goto found;
} } else if (INTEL_INFO(dev_priv)->gen < 9 && HAS_DDI(dev_priv))
/* Do not consider SPLL */
max = 2;
for (i = 0; i < dev_priv->num_shared_dpll; i++) { for (i = 0; i < max; i++) {
pll = &dev_priv->shared_dplls[i]; pll = &dev_priv->shared_dplls[i];
/* Only want to check enabled timings first */ /* Only want to check enabled timings first */
...@@ -9723,6 +9728,8 @@ static void haswell_get_ddi_pll(struct drm_i915_private *dev_priv, ...@@ -9723,6 +9728,8 @@ static void haswell_get_ddi_pll(struct drm_i915_private *dev_priv,
case PORT_CLK_SEL_WRPLL2: case PORT_CLK_SEL_WRPLL2:
pipe_config->shared_dpll = DPLL_ID_WRPLL2; pipe_config->shared_dpll = DPLL_ID_WRPLL2;
break; break;
case PORT_CLK_SEL_SPLL:
pipe_config->shared_dpll = DPLL_ID_SPLL;
} }
} }
...@@ -12003,9 +12010,10 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc, ...@@ -12003,9 +12010,10 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc,
pipe_config->dpll_hw_state.cfgcr1, pipe_config->dpll_hw_state.cfgcr1,
pipe_config->dpll_hw_state.cfgcr2); pipe_config->dpll_hw_state.cfgcr2);
} else if (HAS_DDI(dev)) { } else if (HAS_DDI(dev)) {
DRM_DEBUG_KMS("ddi_pll_sel: %u; dpll_hw_state: wrpll: 0x%x\n", DRM_DEBUG_KMS("ddi_pll_sel: %u; dpll_hw_state: wrpll: 0x%x spll: 0x%x\n",
pipe_config->ddi_pll_sel, pipe_config->ddi_pll_sel,
pipe_config->dpll_hw_state.wrpll); pipe_config->dpll_hw_state.wrpll,
pipe_config->dpll_hw_state.spll);
} else { } else {
DRM_DEBUG_KMS("dpll_hw_state: dpll: 0x%x, dpll_md: 0x%x, " DRM_DEBUG_KMS("dpll_hw_state: dpll: 0x%x, dpll_md: 0x%x, "
"fp0: 0x%x, fp1: 0x%x\n", "fp0: 0x%x, fp1: 0x%x\n",
...@@ -12528,6 +12536,7 @@ intel_pipe_config_compare(struct drm_device *dev, ...@@ -12528,6 +12536,7 @@ intel_pipe_config_compare(struct drm_device *dev,
PIPE_CONF_CHECK_X(dpll_hw_state.fp0); PIPE_CONF_CHECK_X(dpll_hw_state.fp0);
PIPE_CONF_CHECK_X(dpll_hw_state.fp1); PIPE_CONF_CHECK_X(dpll_hw_state.fp1);
PIPE_CONF_CHECK_X(dpll_hw_state.wrpll); PIPE_CONF_CHECK_X(dpll_hw_state.wrpll);
PIPE_CONF_CHECK_X(dpll_hw_state.spll);
PIPE_CONF_CHECK_X(dpll_hw_state.ctrl1); PIPE_CONF_CHECK_X(dpll_hw_state.ctrl1);
PIPE_CONF_CHECK_X(dpll_hw_state.cfgcr1); PIPE_CONF_CHECK_X(dpll_hw_state.cfgcr1);
PIPE_CONF_CHECK_X(dpll_hw_state.cfgcr2); PIPE_CONF_CHECK_X(dpll_hw_state.cfgcr2);
...@@ -13032,6 +13041,9 @@ static int intel_atomic_check(struct drm_device *dev, ...@@ -13032,6 +13041,9 @@ static int intel_atomic_check(struct drm_device *dev,
struct intel_crtc_state *pipe_config = struct intel_crtc_state *pipe_config =
to_intel_crtc_state(crtc_state); to_intel_crtc_state(crtc_state);
memset(&to_intel_crtc(crtc)->atomic, 0,
sizeof(struct intel_crtc_atomic_commit));
/* Catch I915_MODE_FLAG_INHERITED */ /* Catch I915_MODE_FLAG_INHERITED */
if (crtc_state->mode.private_flags != crtc->state->mode.private_flags) if (crtc_state->mode.private_flags != crtc->state->mode.private_flags)
crtc_state->mode_changed = true; crtc_state->mode_changed = true;
...@@ -13056,7 +13068,8 @@ static int intel_atomic_check(struct drm_device *dev, ...@@ -13056,7 +13068,8 @@ static int intel_atomic_check(struct drm_device *dev,
if (ret) if (ret)
return ret; return ret;
if (intel_pipe_config_compare(state->dev, if (i915.fastboot &&
intel_pipe_config_compare(state->dev,
to_intel_crtc_state(crtc->state), to_intel_crtc_state(crtc->state),
pipe_config, true)) { pipe_config, true)) {
crtc_state->mode_changed = false; crtc_state->mode_changed = false;
...@@ -14364,16 +14377,17 @@ static int intel_framebuffer_init(struct drm_device *dev, ...@@ -14364,16 +14377,17 @@ static int intel_framebuffer_init(struct drm_device *dev,
static struct drm_framebuffer * static struct drm_framebuffer *
intel_user_framebuffer_create(struct drm_device *dev, intel_user_framebuffer_create(struct drm_device *dev,
struct drm_file *filp, struct drm_file *filp,
struct drm_mode_fb_cmd2 *mode_cmd) struct drm_mode_fb_cmd2 *user_mode_cmd)
{ {
struct drm_i915_gem_object *obj; struct drm_i915_gem_object *obj;
struct drm_mode_fb_cmd2 mode_cmd = *user_mode_cmd;
obj = to_intel_bo(drm_gem_object_lookup(dev, filp, obj = to_intel_bo(drm_gem_object_lookup(dev, filp,
mode_cmd->handles[0])); mode_cmd.handles[0]));
if (&obj->base == NULL) if (&obj->base == NULL)
return ERR_PTR(-ENOENT); return ERR_PTR(-ENOENT);
return intel_framebuffer_create(dev, mode_cmd, obj); return intel_framebuffer_create(dev, &mode_cmd, obj);
} }
#ifndef CONFIG_DRM_FBDEV_EMULATION #ifndef CONFIG_DRM_FBDEV_EMULATION
...@@ -14705,6 +14719,9 @@ static struct intel_quirk intel_quirks[] = { ...@@ -14705,6 +14719,9 @@ static struct intel_quirk intel_quirks[] = {
/* Apple Macbook 2,1 (Core 2 T7400) */ /* Apple Macbook 2,1 (Core 2 T7400) */
{ 0x27a2, 0x8086, 0x7270, quirk_backlight_present }, { 0x27a2, 0x8086, 0x7270, quirk_backlight_present },
/* Apple Macbook 4,1 */
{ 0x2a02, 0x106b, 0x00a1, quirk_backlight_present },
/* Toshiba CB35 Chromebook (Celeron 2955U) */ /* Toshiba CB35 Chromebook (Celeron 2955U) */
{ 0x0a06, 0x1179, 0x0a88, quirk_backlight_present }, { 0x0a06, 0x1179, 0x0a88, quirk_backlight_present },
......
...@@ -4449,7 +4449,7 @@ static void gen6_set_rps(struct drm_device *dev, u8 val) ...@@ -4449,7 +4449,7 @@ static void gen6_set_rps(struct drm_device *dev, u8 val)
POSTING_READ(GEN6_RPNSWREQ); POSTING_READ(GEN6_RPNSWREQ);
dev_priv->rps.cur_freq = val; dev_priv->rps.cur_freq = val;
trace_intel_gpu_freq_change(val * 50); trace_intel_gpu_freq_change(intel_gpu_freq(dev_priv, val));
} }
static void valleyview_set_rps(struct drm_device *dev, u8 val) static void valleyview_set_rps(struct drm_device *dev, u8 val)
...@@ -7255,7 +7255,8 @@ static int chv_freq_opcode(struct drm_i915_private *dev_priv, int val) ...@@ -7255,7 +7255,8 @@ static int chv_freq_opcode(struct drm_i915_private *dev_priv, int val)
int intel_gpu_freq(struct drm_i915_private *dev_priv, int val) int intel_gpu_freq(struct drm_i915_private *dev_priv, int val)
{ {
if (IS_GEN9(dev_priv->dev)) if (IS_GEN9(dev_priv->dev))
return (val * GT_FREQUENCY_MULTIPLIER) / GEN9_FREQ_SCALER; return DIV_ROUND_CLOSEST(val * GT_FREQUENCY_MULTIPLIER,
GEN9_FREQ_SCALER);
else if (IS_CHERRYVIEW(dev_priv->dev)) else if (IS_CHERRYVIEW(dev_priv->dev))
return chv_gpu_freq(dev_priv, val); return chv_gpu_freq(dev_priv, val);
else if (IS_VALLEYVIEW(dev_priv->dev)) else if (IS_VALLEYVIEW(dev_priv->dev))
...@@ -7267,13 +7268,14 @@ int intel_gpu_freq(struct drm_i915_private *dev_priv, int val) ...@@ -7267,13 +7268,14 @@ int intel_gpu_freq(struct drm_i915_private *dev_priv, int val)
int intel_freq_opcode(struct drm_i915_private *dev_priv, int val) int intel_freq_opcode(struct drm_i915_private *dev_priv, int val)
{ {
if (IS_GEN9(dev_priv->dev)) if (IS_GEN9(dev_priv->dev))
return (val * GEN9_FREQ_SCALER) / GT_FREQUENCY_MULTIPLIER; return DIV_ROUND_CLOSEST(val * GEN9_FREQ_SCALER,
GT_FREQUENCY_MULTIPLIER);
else if (IS_CHERRYVIEW(dev_priv->dev)) else if (IS_CHERRYVIEW(dev_priv->dev))
return chv_freq_opcode(dev_priv, val); return chv_freq_opcode(dev_priv, val);
else if (IS_VALLEYVIEW(dev_priv->dev)) else if (IS_VALLEYVIEW(dev_priv->dev))
return byt_freq_opcode(dev_priv, val); return byt_freq_opcode(dev_priv, val);
else else
return val / GT_FREQUENCY_MULTIPLIER; return DIV_ROUND_CLOSEST(val, GT_FREQUENCY_MULTIPLIER);
} }
struct request_boost { struct request_boost {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment