Skip to content

Commit b97b869

Browse files
committed
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie: "Nothing too major, radeon still has some dpm changes for off by default. Radeon, intel, msm: - radeon: a few more dpm fixes (still off by default), uvd fixes - i915: runtime warn backtrace and regression fix - msm: iommu changes fallout" * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (27 commits) drm/msm: use drm_gem_dumb_destroy helper drm/msm: deal with mach/iommu.h removal drm/msm: Remove iommu include from mdp4_kms.c drm/msm: Odd PTR_ERR usage drm/i915: Fix up usage of SHRINK_STOP drm/radeon: fix hdmi audio on DCE3.0/3.1 asics drm/i915: preserve pipe A quirk in i9xx_set_pipeconf drm/i915/tv: clear adjusted_mode.flags drm/i915/dp: increase i2c-over-aux retry interval on AUX DEFER drm/radeon/cik: fix overflow in vram fetch drm/radeon: add missing hdmi callbacks for rv6xx drm/i915: Use a temporary va_list for two-pass string handling drm/radeon/uvd: lower msg&fb buffer requirements on UVD3 drm/radeon: disable tests/benchmarks if accel is disabled drm/radeon: don't set default clocks for SI when DPM is disabled drm/radeon/dpm/ci: filter clocks based on voltage/clk dep tables drm/radeon/dpm/si: filter clocks based on voltage/clk dep tables drm/radeon/dpm/ni: filter clocks based on voltage/clk dep tables drm/radeon/dpm/btc: filter clocks based on voltage/clk dep tables drm/radeon/dpm: fetch the max clk from voltage dep tables helper ...
2 parents 669fc2f + 6654417 commit b97b869

26 files changed

Lines changed: 266 additions & 77 deletions

‎drivers/gpu/drm/i915/i915_gem.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4800,10 +4800,10 @@ i915_gem_inactive_count(struct shrinker *shrinker, struct shrink_control *sc)
48004800

48014801
if (!mutex_trylock(&dev->struct_mutex)) {
48024802
if (!mutex_is_locked_by(&dev->struct_mutex, current))
4803-
return SHRINK_STOP;
4803+
return 0;
48044804

48054805
if (dev_priv->mm.shrinker_no_lock_stealing)
4806-
return SHRINK_STOP;
4806+
return 0;
48074807

48084808
unlock = false;
48094809
}
@@ -4901,10 +4901,10 @@ i915_gem_inactive_scan(struct shrinker *shrinker, struct shrink_control *sc)
49014901

49024902
if (!mutex_trylock(&dev->struct_mutex)) {
49034903
if (!mutex_is_locked_by(&dev->struct_mutex, current))
4904-
return 0;
4904+
return SHRINK_STOP;
49054905

49064906
if (dev_priv->mm.shrinker_no_lock_stealing)
4907-
return 0;
4907+
return SHRINK_STOP;
49084908

49094909
unlock = false;
49104910
}

‎drivers/gpu/drm/i915/i915_gpu_error.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,10 @@ static void i915_error_vprintf(struct drm_i915_error_state_buf *e,
143143

144144
/* Seek the first printf which is hits start position */
145145
if (e->pos < e->start) {
146-
len = vsnprintf(NULL, 0, f, args);
147-
if (!__i915_error_seek(e, len))
146+
va_list tmp;
147+
148+
va_copy(tmp, args);
149+
if (!__i915_error_seek(e, vsnprintf(NULL, 0, f, tmp)))
148150
return;
149151
}
150152

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4775,6 +4775,10 @@ static void i9xx_set_pipeconf(struct intel_crtc *intel_crtc)
47754775

47764776
pipeconf = 0;
47774777

4778+
if (dev_priv->quirks & QUIRK_PIPEA_FORCE &&
4779+
I915_READ(PIPECONF(intel_crtc->pipe)) & PIPECONF_ENABLE)
4780+
pipeconf |= PIPECONF_ENABLE;
4781+
47784782
if (intel_crtc->pipe == 0 && INTEL_INFO(dev)->gen < 4) {
47794783
/* Enable pixel doubling when the dot clock is > 90% of the (display)
47804784
* core speed.

‎drivers/gpu/drm/i915/intel_dp.c‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,18 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode,
588588
DRM_DEBUG_KMS("aux_ch native nack\n");
589589
return -EREMOTEIO;
590590
case AUX_NATIVE_REPLY_DEFER:
591-
udelay(100);
591+
/*
592+
* For now, just give more slack to branch devices. We
593+
* could check the DPCD for I2C bit rate capabilities,
594+
* and if available, adjust the interval. We could also
595+
* be more careful with DP-to-Legacy adapters where a
596+
* long legacy cable may force very low I2C bit rates.
597+
*/
598+
if (intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
599+
DP_DWN_STRM_PORT_PRESENT)
600+
usleep_range(500, 600);
601+
else
602+
usleep_range(300, 400);
592603
continue;
593604
default:
594605
DRM_ERROR("aux_ch invalid native reply 0x%02x\n",

‎drivers/gpu/drm/i915/intel_tv.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,14 @@ intel_tv_compute_config(struct intel_encoder *encoder,
916916
DRM_DEBUG_KMS("forcing bpc to 8 for TV\n");
917917
pipe_config->pipe_bpp = 8*3;
918918

919+
/* TV has it's own notion of sync and other mode flags, so clear them. */
920+
pipe_config->adjusted_mode.flags = 0;
921+
922+
/*
923+
* FIXME: We don't check whether the input mode is actually what we want
924+
* or whether userspace is doing something stupid.
925+
*/
926+
919927
return true;
920928
}
921929

‎drivers/gpu/drm/msm/mdp4/mdp4_kms.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
#include "msm_drv.h"
2020
#include "mdp4_kms.h"
2121

22-
#include <mach/iommu.h>
23-
2422
static struct mdp4_platform_config *mdp4_get_config(struct platform_device *dev);
2523

2624
static int mdp4_hw_init(struct msm_kms *kms)

‎drivers/gpu/drm/msm/msm_drv.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
#include "msm_drv.h"
1919
#include "msm_gpu.h"
2020

21-
#include <mach/iommu.h>
22-
2321
static void msm_fb_output_poll_changed(struct drm_device *dev)
2422
{
2523
struct msm_drm_private *priv = dev->dev_private;
@@ -62,6 +60,8 @@ int msm_iommu_attach(struct drm_device *dev, struct iommu_domain *iommu,
6260
int i, ret;
6361

6462
for (i = 0; i < cnt; i++) {
63+
/* TODO maybe some day msm iommu won't require this hack: */
64+
struct device *msm_iommu_get_ctx(const char *ctx_name);
6565
struct device *ctx = msm_iommu_get_ctx(names[i]);
6666
if (!ctx)
6767
continue;
@@ -199,7 +199,7 @@ static int msm_load(struct drm_device *dev, unsigned long flags)
199199
* imx drm driver on iMX5
200200
*/
201201
dev_err(dev->dev, "failed to load kms\n");
202-
ret = PTR_ERR(priv->kms);
202+
ret = PTR_ERR(kms);
203203
goto fail;
204204
}
205205

@@ -697,7 +697,7 @@ static struct drm_driver msm_driver = {
697697
.gem_vm_ops = &vm_ops,
698698
.dumb_create = msm_gem_dumb_create,
699699
.dumb_map_offset = msm_gem_dumb_map_offset,
700-
.dumb_destroy = msm_gem_dumb_destroy,
700+
.dumb_destroy = drm_gem_dumb_destroy,
701701
#ifdef CONFIG_DEBUG_FS
702702
.debugfs_init = msm_debugfs_init,
703703
.debugfs_cleanup = msm_debugfs_cleanup,

‎drivers/gpu/drm/msm/msm_gem.c‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -319,13 +319,6 @@ int msm_gem_dumb_create(struct drm_file *file, struct drm_device *dev,
319319
MSM_BO_SCANOUT | MSM_BO_WC, &args->handle);
320320
}
321321

322-
int msm_gem_dumb_destroy(struct drm_file *file, struct drm_device *dev,
323-
uint32_t handle)
324-
{
325-
/* No special work needed, drop the reference and see what falls out */
326-
return drm_gem_handle_delete(file, handle);
327-
}
328-
329322
int msm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
330323
uint32_t handle, uint64_t *offset)
331324
{

‎drivers/gpu/drm/radeon/btc_dpm.c‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,6 +1168,23 @@ static const struct radeon_blacklist_clocks btc_blacklist_clocks[] =
11681168
{ 25000, 30000, RADEON_SCLK_UP }
11691169
};
11701170

1171+
void btc_get_max_clock_from_voltage_dependency_table(struct radeon_clock_voltage_dependency_table *table,
1172+
u32 *max_clock)
1173+
{
1174+
u32 i, clock = 0;
1175+
1176+
if ((table == NULL) || (table->count == 0)) {
1177+
*max_clock = clock;
1178+
return;
1179+
}
1180+
1181+
for (i = 0; i < table->count; i++) {
1182+
if (clock < table->entries[i].clk)
1183+
clock = table->entries[i].clk;
1184+
}
1185+
*max_clock = clock;
1186+
}
1187+
11711188
void btc_apply_voltage_dependency_rules(struct radeon_clock_voltage_dependency_table *table,
11721189
u32 clock, u16 max_voltage, u16 *voltage)
11731190
{
@@ -2080,6 +2097,7 @@ static void btc_apply_state_adjust_rules(struct radeon_device *rdev,
20802097
bool disable_mclk_switching;
20812098
u32 mclk, sclk;
20822099
u16 vddc, vddci;
2100+
u32 max_sclk_vddc, max_mclk_vddci, max_mclk_vddc;
20832101

20842102
if ((rdev->pm.dpm.new_active_crtc_count > 1) ||
20852103
btc_dpm_vblank_too_short(rdev))
@@ -2121,6 +2139,39 @@ static void btc_apply_state_adjust_rules(struct radeon_device *rdev,
21212139
ps->low.vddci = max_limits->vddci;
21222140
}
21232141

2142+
/* limit clocks to max supported clocks based on voltage dependency tables */
2143+
btc_get_max_clock_from_voltage_dependency_table(&rdev->pm.dpm.dyn_state.vddc_dependency_on_sclk,
2144+
&max_sclk_vddc);
2145+
btc_get_max_clock_from_voltage_dependency_table(&rdev->pm.dpm.dyn_state.vddci_dependency_on_mclk,
2146+
&max_mclk_vddci);
2147+
btc_get_max_clock_from_voltage_dependency_table(&rdev->pm.dpm.dyn_state.vddc_dependency_on_mclk,
2148+
&max_mclk_vddc);
2149+
2150+
if (max_sclk_vddc) {
2151+
if (ps->low.sclk > max_sclk_vddc)
2152+
ps->low.sclk = max_sclk_vddc;
2153+
if (ps->medium.sclk > max_sclk_vddc)
2154+
ps->medium.sclk = max_sclk_vddc;
2155+
if (ps->high.sclk > max_sclk_vddc)
2156+
ps->high.sclk = max_sclk_vddc;
2157+
}
2158+
if (max_mclk_vddci) {
2159+
if (ps->low.mclk > max_mclk_vddci)
2160+
ps->low.mclk = max_mclk_vddci;
2161+
if (ps->medium.mclk > max_mclk_vddci)
2162+
ps->medium.mclk = max_mclk_vddci;
2163+
if (ps->high.mclk > max_mclk_vddci)
2164+
ps->high.mclk = max_mclk_vddci;
2165+
}
2166+
if (max_mclk_vddc) {
2167+
if (ps->low.mclk > max_mclk_vddc)
2168+
ps->low.mclk = max_mclk_vddc;
2169+
if (ps->medium.mclk > max_mclk_vddc)
2170+
ps->medium.mclk = max_mclk_vddc;
2171+
if (ps->high.mclk > max_mclk_vddc)
2172+
ps->high.mclk = max_mclk_vddc;
2173+
}
2174+
21242175
/* XXX validate the min clocks required for display */
21252176

21262177
if (disable_mclk_switching) {

‎drivers/gpu/drm/radeon/btc_dpm.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ void btc_adjust_clock_combinations(struct radeon_device *rdev,
4646
struct rv7xx_pl *pl);
4747
void btc_apply_voltage_dependency_rules(struct radeon_clock_voltage_dependency_table *table,
4848
u32 clock, u16 max_voltage, u16 *voltage);
49+
void btc_get_max_clock_from_voltage_dependency_table(struct radeon_clock_voltage_dependency_table *table,
50+
u32 *max_clock);
4951
void btc_apply_voltage_delta_rules(struct radeon_device *rdev,
5052
u16 max_vddc, u16 max_vddci,
5153
u16 *vddc, u16 *vddci);

0 commit comments

Comments
 (0)