aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-08-07 21:18:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-08-07 21:18:14 -0400
commit981dae742bc67ccd078bab0affdfb5eb78fc5697 (patch)
tree1a5cd353ef439920a4a7c15b26541429df99e749
parent49d7c6559bf2ab4f1d56be131ab9571a51fc71bd (diff)
parent209e4dbc8dcdb2b1839f18fd1cf07ec7bedadf4d (diff)
Merge tag 'drm-intel-fixes-2015-08-07' of git://anongit.freedesktop.org/drm-intel
Pull drm fixes from Daniel Vetter: "One i915 regression fix and a drm core one since Dave's not around, both introduced in 4.2 so not cc: stable. The fix for the warning Ted reported isn't in here yet since he didn't yet supply a tested-by and I can't repro this one myself (it's in fixup code that needs firmware doing something i915 wouldn't do)" * tag 'drm-intel-fixes-2015-08-07' of git://anongit.freedesktop.org/drm-intel: drm/vblank: Use u32 consistently for vblank counters drm/i915: Allow parsing of variable size child device entries from VBT
-rw-r--r--drivers/gpu/drm/drm_irq.c2
-rw-r--r--drivers/gpu/drm/i915/intel_bios.c27
-rw-r--r--include/drm/drmP.h2
3 files changed, 25 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index f9cc68fbd2a3..b50fa0afd907 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -75,7 +75,7 @@ module_param_named(timestamp_precision_usec, drm_timestamp_precision, int, 0600)
75module_param_named(timestamp_monotonic, drm_timestamp_monotonic, int, 0600); 75module_param_named(timestamp_monotonic, drm_timestamp_monotonic, int, 0600);
76 76
77static void store_vblank(struct drm_device *dev, int crtc, 77static void store_vblank(struct drm_device *dev, int crtc,
78 unsigned vblank_count_inc, 78 u32 vblank_count_inc,
79 struct timeval *t_vblank) 79 struct timeval *t_vblank)
80{ 80{
81 struct drm_vblank_crtc *vblank = &dev->vblank[crtc]; 81 struct drm_vblank_crtc *vblank = &dev->vblank[crtc];
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 198fc3c3291b..3dcd59e694db 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -1075,15 +1075,34 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
1075 const union child_device_config *p_child; 1075 const union child_device_config *p_child;
1076 union child_device_config *child_dev_ptr; 1076 union child_device_config *child_dev_ptr;
1077 int i, child_device_num, count; 1077 int i, child_device_num, count;
1078 u16 block_size; 1078 u8 expected_size;
1079 u16 block_size;
1079 1080
1080 p_defs = find_section(bdb, BDB_GENERAL_DEFINITIONS); 1081 p_defs = find_section(bdb, BDB_GENERAL_DEFINITIONS);
1081 if (!p_defs) { 1082 if (!p_defs) {
1082 DRM_DEBUG_KMS("No general definition block is found, no devices defined.\n"); 1083 DRM_DEBUG_KMS("No general definition block is found, no devices defined.\n");
1083 return; 1084 return;
1084 } 1085 }
1085 if (p_defs->child_dev_size < sizeof(*p_child)) { 1086 if (bdb->version < 195) {
1086 DRM_ERROR("General definiton block child device size is too small.\n"); 1087 expected_size = 33;
1088 } else if (bdb->version == 195) {
1089 expected_size = 37;
1090 } else if (bdb->version <= 197) {
1091 expected_size = 38;
1092 } else {
1093 expected_size = 38;
1094 DRM_DEBUG_DRIVER("Expected child_device_config size for BDB version %u not known; assuming %u\n",
1095 expected_size, bdb->version);
1096 }
1097
1098 if (expected_size > sizeof(*p_child)) {
1099 DRM_ERROR("child_device_config cannot fit in p_child\n");
1100 return;
1101 }
1102
1103 if (p_defs->child_dev_size != expected_size) {
1104 DRM_ERROR("Size mismatch; child_device_config size=%u (expected %u); bdb->version: %u\n",
1105 p_defs->child_dev_size, expected_size, bdb->version);
1087 return; 1106 return;
1088 } 1107 }
1089 /* get the block size of general definitions */ 1108 /* get the block size of general definitions */
@@ -1130,7 +1149,7 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
1130 1149
1131 child_dev_ptr = dev_priv->vbt.child_dev + count; 1150 child_dev_ptr = dev_priv->vbt.child_dev + count;
1132 count++; 1151 count++;
1133 memcpy(child_dev_ptr, p_child, sizeof(*p_child)); 1152 memcpy(child_dev_ptr, p_child, p_defs->child_dev_size);
1134 } 1153 }
1135 return; 1154 return;
1136} 1155}
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 48db6a56975f..5aa519711e0b 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -691,7 +691,7 @@ struct drm_vblank_crtc {
691 struct timer_list disable_timer; /* delayed disable timer */ 691 struct timer_list disable_timer; /* delayed disable timer */
692 692
693 /* vblank counter, protected by dev->vblank_time_lock for writes */ 693 /* vblank counter, protected by dev->vblank_time_lock for writes */
694 unsigned long count; 694 u32 count;
695 /* vblank timestamps, protected by dev->vblank_time_lock for writes */ 695 /* vblank timestamps, protected by dev->vblank_time_lock for writes */
696 struct timeval time[DRM_VBLANKTIME_RBSIZE]; 696 struct timeval time[DRM_VBLANKTIME_RBSIZE];
697 697