History

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

Linus Torvalds committed 11 years ago

Commit 981dae72 parents 49d7c65 209e4db3 files · +25 −6Browse files

Unified · Split

3 files
  1. drivers/gpu/drm/drm_irq.c +1 −1
  2. drivers/gpu/drm/i915/intel_bios.c +23 −4
  3. include/drm/drmP.h +1 −1
drivers/gpu/drm/drm_irq.c+1−1
@@ -75,7 +75,7 @@ module_param_named(timestamp_precision_usec, drm_timestamp_precision, int, 0600) · 74 unmodified lines
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];
drivers/gpu/drm/i915/intel_bios.c+23−4
@@ -1075,15 +1075,34 @@ parse_device_mapping(struct drm_i915_private *dev_priv, · 1074 unmodified lines
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, · 40 unmodified lines
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}
include/drm/drmP.h+1−1
@@ -691,7 +691,7 @@ struct drm_vblank_crtc { · 690 unmodified lines
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