Skip to content

Commit fea0f9f

Browse files
committed
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie: "Just a few straggling fixes I hoovered up, and an intel fixes pull from Daniel which fixes some regressions, and some mgag200 fixes from Matrox." * 'drm-next' of git://people.freedesktop.org/~airlied/linux: drm/mgag200: Fix framebuffer base address programming drm/mgag200: Convert counter delays to jiffies drm/mgag200: Fix writes into MGA1064_PIX_CLK_CTL register drm/mgag200: Don't change unrelated registers during modeset drm: Only print a debug message when the polled connector has changed drm: Make the HPD status updates debug logs more readable drm: Use names of ioctls in debug traces drm: Remove pointless '-' characters from drm_fb_helper documentation drm: Add kernel-doc for drm_fb_helper_funcs->initial_config drm: refactor call to request_module drm: Don't prune modes loudly when a connector is disconnected drm: Add missing break in the command line mode parsing code drm/i915: clear the stolen fb before resuming Revert "drm/i915: Calculate correct stolen size for GEN7+" drm/i915: hsw: fix link training for eDP on port-A Revert "drm/i915: revert eDP bpp clamping code changes" drm: don't check modeset locks in panic handler drm/i915: Fix pipe enabled mask for pipe C in WM calculations drm/mm: fix dump table BUG drm/i915: Always normalize return timeout for wait_timeout_ioctl
2 parents aef2ea9 + 9f1d036 commit fea0f9f

17 files changed

Lines changed: 213 additions & 156 deletions

‎drivers/gpu/drm/drm_crtc.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ void drm_warn_on_modeset_not_all_locked(struct drm_device *dev)
7878
{
7979
struct drm_crtc *crtc;
8080

81+
/* Locking is currently fubar in the panic handler. */
82+
if (oops_in_progress)
83+
return;
84+
8185
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head)
8286
WARN_ON(!mutex_is_locked(&crtc->mutex));
8387

@@ -246,6 +250,7 @@ char *drm_get_connector_status_name(enum drm_connector_status status)
246250
else
247251
return "unknown";
248252
}
253+
EXPORT_SYMBOL(drm_get_connector_status_name);
249254

250255
/**
251256
* drm_mode_object_get - allocate a new modeset identifier

‎drivers/gpu/drm/drm_crtc_helper.c‎

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
121121
connector->helper_private;
122122
int count = 0;
123123
int mode_flags = 0;
124+
bool verbose_prune = true;
124125

125126
DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id,
126127
drm_get_connector_name(connector));
@@ -149,6 +150,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
149150
DRM_DEBUG_KMS("[CONNECTOR:%d:%s] disconnected\n",
150151
connector->base.id, drm_get_connector_name(connector));
151152
drm_mode_connector_update_edid_property(connector, NULL);
153+
verbose_prune = false;
152154
goto prune;
153155
}
154156

@@ -182,7 +184,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
182184
}
183185

184186
prune:
185-
drm_mode_prune_invalid(dev, &connector->modes, true);
187+
drm_mode_prune_invalid(dev, &connector->modes, verbose_prune);
186188

187189
if (list_empty(&connector->modes))
188190
return 0;
@@ -1005,12 +1007,20 @@ static void output_poll_execute(struct work_struct *work)
10051007
continue;
10061008

10071009
connector->status = connector->funcs->detect(connector, false);
1008-
DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %d to %d\n",
1009-
connector->base.id,
1010-
drm_get_connector_name(connector),
1011-
old_status, connector->status);
1012-
if (old_status != connector->status)
1010+
if (old_status != connector->status) {
1011+
const char *old, *new;
1012+
1013+
old = drm_get_connector_status_name(old_status);
1014+
new = drm_get_connector_status_name(connector->status);
1015+
1016+
DRM_DEBUG_KMS("[CONNECTOR:%d:%s] "
1017+
"status updated from %s to %s\n",
1018+
connector->base.id,
1019+
drm_get_connector_name(connector),
1020+
old, new);
1021+
10131022
changed = true;
1023+
}
10141024
}
10151025

10161026
mutex_unlock(&dev->mode_config.mutex);
@@ -1083,10 +1093,11 @@ void drm_helper_hpd_irq_event(struct drm_device *dev)
10831093
old_status = connector->status;
10841094

10851095
connector->status = connector->funcs->detect(connector, false);
1086-
DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %d to %d\n",
1096+
DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %s to %s\n",
10871097
connector->base.id,
10881098
drm_get_connector_name(connector),
1089-
old_status, connector->status);
1099+
drm_get_connector_status_name(old_status),
1100+
drm_get_connector_status_name(connector->status));
10901101
if (old_status != connector->status)
10911102
changed = true;
10921103
}

‎drivers/gpu/drm/drm_drv.c‎

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static int drm_version(struct drm_device *dev, void *data,
5757
struct drm_file *file_priv);
5858

5959
#define DRM_IOCTL_DEF(ioctl, _func, _flags) \
60-
[DRM_IOCTL_NR(ioctl)] = {.cmd = ioctl, .func = _func, .flags = _flags, .cmd_drv = 0}
60+
[DRM_IOCTL_NR(ioctl)] = {.cmd = ioctl, .func = _func, .flags = _flags, .cmd_drv = 0, .name = #ioctl}
6161

6262
/** Ioctl table */
6363
static const struct drm_ioctl_desc drm_ioctls[] = {
@@ -375,7 +375,7 @@ long drm_ioctl(struct file *filp,
375375
{
376376
struct drm_file *file_priv = filp->private_data;
377377
struct drm_device *dev;
378-
const struct drm_ioctl_desc *ioctl;
378+
const struct drm_ioctl_desc *ioctl = NULL;
379379
drm_ioctl_t *func;
380380
unsigned int nr = DRM_IOCTL_NR(cmd);
381381
int retcode = -EINVAL;
@@ -392,11 +392,6 @@ long drm_ioctl(struct file *filp,
392392
atomic_inc(&dev->counts[_DRM_STAT_IOCTLS]);
393393
++file_priv->ioctl_count;
394394

395-
DRM_DEBUG("pid=%d, cmd=0x%02x, nr=0x%02x, dev 0x%lx, auth=%d\n",
396-
task_pid_nr(current), cmd, nr,
397-
(long)old_encode_dev(file_priv->minor->device),
398-
file_priv->authenticated);
399-
400395
if ((nr >= DRM_CORE_IOCTL_COUNT) &&
401396
((nr < DRM_COMMAND_BASE) || (nr >= DRM_COMMAND_END)))
402397
goto err_i1;
@@ -417,6 +412,11 @@ long drm_ioctl(struct file *filp,
417412
} else
418413
goto err_i1;
419414

415+
DRM_DEBUG("pid=%d, dev=0x%lx, auth=%d, %s\n",
416+
task_pid_nr(current),
417+
(long)old_encode_dev(file_priv->minor->device),
418+
file_priv->authenticated, ioctl->name);
419+
420420
/* Do not trust userspace, use our own definition */
421421
func = ioctl->func;
422422
/* is there a local override? */
@@ -471,6 +471,12 @@ long drm_ioctl(struct file *filp,
471471
}
472472

473473
err_i1:
474+
if (!ioctl)
475+
DRM_DEBUG("invalid iotcl: pid=%d, dev=0x%lx, auth=%d, cmd=0x%02x, nr=0x%02x\n",
476+
task_pid_nr(current),
477+
(long)old_encode_dev(file_priv->minor->device),
478+
file_priv->authenticated, cmd, nr);
479+
474480
if (kdata != stack_kdata)
475481
kfree(kdata);
476482
atomic_dec(&dev->ioctl_count);

‎drivers/gpu/drm/drm_encoder_slave.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,12 @@ int drm_i2c_encoder_init(struct drm_device *dev,
5454
struct i2c_adapter *adap,
5555
const struct i2c_board_info *info)
5656
{
57-
char modalias[sizeof(I2C_MODULE_PREFIX)
58-
+ I2C_NAME_SIZE];
5957
struct module *module = NULL;
6058
struct i2c_client *client;
6159
struct drm_i2c_encoder_driver *encoder_drv;
6260
int err = 0;
6361

64-
snprintf(modalias, sizeof(modalias),
65-
"%s%s", I2C_MODULE_PREFIX, info->type);
66-
request_module(modalias);
62+
request_module("%s%s", I2C_MODULE_PREFIX, info->type);
6763

6864
client = i2c_new_device(adap, info);
6965
if (!client) {

‎drivers/gpu/drm/drm_mm.c‎

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -755,33 +755,35 @@ void drm_mm_debug_table(struct drm_mm *mm, const char *prefix)
755755
EXPORT_SYMBOL(drm_mm_debug_table);
756756

757757
#if defined(CONFIG_DEBUG_FS)
758-
int drm_mm_dump_table(struct seq_file *m, struct drm_mm *mm)
758+
static unsigned long drm_mm_dump_hole(struct seq_file *m, struct drm_mm_node *entry)
759759
{
760-
struct drm_mm_node *entry;
761-
unsigned long total_used = 0, total_free = 0, total = 0;
762760
unsigned long hole_start, hole_end, hole_size;
763761

764-
hole_start = drm_mm_hole_node_start(&mm->head_node);
765-
hole_end = drm_mm_hole_node_end(&mm->head_node);
766-
hole_size = hole_end - hole_start;
767-
if (hole_size)
762+
if (entry->hole_follows) {
763+
hole_start = drm_mm_hole_node_start(entry);
764+
hole_end = drm_mm_hole_node_end(entry);
765+
hole_size = hole_end - hole_start;
768766
seq_printf(m, "0x%08lx-0x%08lx: 0x%08lx: free\n",
769767
hole_start, hole_end, hole_size);
770-
total_free += hole_size;
768+
return hole_size;
769+
}
770+
771+
return 0;
772+
}
773+
774+
int drm_mm_dump_table(struct seq_file *m, struct drm_mm *mm)
775+
{
776+
struct drm_mm_node *entry;
777+
unsigned long total_used = 0, total_free = 0, total = 0;
778+
779+
total_free += drm_mm_dump_hole(m, &mm->head_node);
771780

772781
drm_mm_for_each_node(entry, mm) {
773782
seq_printf(m, "0x%08lx-0x%08lx: 0x%08lx: used\n",
774783
entry->start, entry->start + entry->size,
775784
entry->size);
776785
total_used += entry->size;
777-
if (entry->hole_follows) {
778-
hole_start = drm_mm_hole_node_start(entry);
779-
hole_end = drm_mm_hole_node_end(entry);
780-
hole_size = hole_end - hole_start;
781-
seq_printf(m, "0x%08lx-0x%08lx: 0x%08lx: free\n",
782-
hole_start, hole_end, hole_size);
783-
total_free += hole_size;
784-
}
786+
total_free += drm_mm_dump_hole(m, entry);
785787
}
786788
total = total_free + total_used;
787789

‎drivers/gpu/drm/drm_modes.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,6 +1143,7 @@ bool drm_mode_parse_command_line_for_connector(const char *mode_option,
11431143
was_digit = false;
11441144
} else
11451145
goto done;
1146+
break;
11461147
case '0' ... '9':
11471148
was_digit = true;
11481149
break;

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,8 @@ static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno,
10451045
if (timeout) {
10461046
struct timespec sleep_time = timespec_sub(now, before);
10471047
*timeout = timespec_sub(*timeout, sleep_time);
1048+
if (!timespec_valid(timeout)) /* i.e. negative time remains */
1049+
set_normalized_timespec(timeout, 0, 0);
10481050
}
10491051

10501052
switch (end) {
@@ -1053,8 +1055,6 @@ static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno,
10531055
case -ERESTARTSYS: /* Signal */
10541056
return (int)end;
10551057
case 0: /* Timeout */
1056-
if (timeout)
1057-
set_normalized_timespec(timeout, 0, 0);
10581058
return -ETIME;
10591059
default: /* Completed */
10601060
WARN_ON(end < 0); /* We're not aware of other errors */
@@ -2377,10 +2377,8 @@ i915_gem_wait_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
23772377
mutex_unlock(&dev->struct_mutex);
23782378

23792379
ret = __wait_seqno(ring, seqno, reset_counter, true, timeout);
2380-
if (timeout) {
2381-
WARN_ON(!timespec_valid(timeout));
2380+
if (timeout)
23822381
args->timeout_ns = timespec_to_ns(timeout);
2383-
}
23842382
return ret;
23852383

23862384
out:

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

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -709,15 +709,6 @@ static inline size_t gen6_get_stolen_size(u16 snb_gmch_ctl)
709709
return snb_gmch_ctl << 25; /* 32 MB units */
710710
}
711711

712-
static inline size_t gen7_get_stolen_size(u16 snb_gmch_ctl)
713-
{
714-
static const int stolen_decoder[] = {
715-
0, 0, 0, 0, 0, 32, 48, 64, 128, 256, 96, 160, 224, 352};
716-
snb_gmch_ctl >>= IVB_GMCH_GMS_SHIFT;
717-
snb_gmch_ctl &= IVB_GMCH_GMS_MASK;
718-
return stolen_decoder[snb_gmch_ctl] << 20;
719-
}
720-
721712
static int gen6_gmch_probe(struct drm_device *dev,
722713
size_t *gtt_total,
723714
size_t *stolen,
@@ -747,11 +738,7 @@ static int gen6_gmch_probe(struct drm_device *dev,
747738
pci_read_config_word(dev->pdev, SNB_GMCH_CTRL, &snb_gmch_ctl);
748739
gtt_size = gen6_get_total_gtt_size(snb_gmch_ctl);
749740

750-
if (IS_GEN7(dev) && !IS_VALLEYVIEW(dev))
751-
*stolen = gen7_get_stolen_size(snb_gmch_ctl);
752-
else
753-
*stolen = gen6_get_stolen_size(snb_gmch_ctl);
754-
741+
*stolen = gen6_get_stolen_size(snb_gmch_ctl);
755742
*gtt_total = (gtt_size / sizeof(gen6_gtt_pte_t)) << PAGE_SHIFT;
756743

757744
/* For Modern GENs the PTEs and register space are split in the BAR */

‎drivers/gpu/drm/i915/i915_reg.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@
4646
#define SNB_GMCH_GGMS_MASK 0x3
4747
#define SNB_GMCH_GMS_SHIFT 3 /* Graphics Mode Select */
4848
#define SNB_GMCH_GMS_MASK 0x1f
49-
#define IVB_GMCH_GMS_SHIFT 4
50-
#define IVB_GMCH_GMS_MASK 0xf
5149

5250

5351
/* PCI config space */

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,6 +1265,8 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder)
12651265
intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
12661266
intel_dp_start_link_train(intel_dp);
12671267
intel_dp_complete_link_train(intel_dp);
1268+
if (port != PORT_A)
1269+
intel_dp_stop_link_train(intel_dp);
12681270
}
12691271
}
12701272

@@ -1326,6 +1328,9 @@ static void intel_enable_ddi(struct intel_encoder *intel_encoder)
13261328
} else if (type == INTEL_OUTPUT_EDP) {
13271329
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
13281330

1331+
if (port == PORT_A)
1332+
intel_dp_stop_link_train(intel_dp);
1333+
13291334
ironlake_edp_backlight_on(intel_dp);
13301335
}
13311336

0 commit comments

Comments
 (0)