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
7575 module_param_named(timestamp_monotonic, drm_timestamp_monotonic, int, 0600);
7676
7777 static void store_vblank(struct drm_device *dev, int crtc,
78− unsigned vblank_count_inc,
78+ u32 vblank_count_inc,
7979 struct timeval *t_vblank)
8080 {
8181 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
10751075 const union child_device_config *p_child;
10761076 union child_device_config *child_dev_ptr;
10771077 int i, child_device_num, count;
1078− u16 block_size;
1078+ u8 expected_size;
1079+ u16 block_size;
10791080
10801081 p_defs = find_section(bdb, BDB_GENERAL_DEFINITIONS);
10811082 if (!p_defs) {
10821083 DRM_DEBUG_KMS("No general definition block is found, no devices defined.\n");
10831084 return;
10841085 }
1085− if (p_defs->child_dev_size < sizeof(*p_child)) {
1086− DRM_ERROR("General definiton block child device size is too small.\n");
1086+ if (bdb->version < 195) {
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);
10871106 return;
10881107 }
10891108 /* get the block size of general definitions */
@@ -1130,7 +1149,7 @@ parse_device_mapping(struct drm_i915_private *dev_priv, · 40 unmodified lines
11301149
11311150 child_dev_ptr = dev_priv->vbt.child_dev + count;
11321151 count++;
1133− memcpy(child_dev_ptr, p_child, sizeof(*p_child));
1152+ memcpy(child_dev_ptr, p_child, p_defs->child_dev_size);
11341153 }
11351154 return;
11361155 }
include/drm/drmP.h+1−1
@@ -691,7 +691,7 @@ struct drm_vblank_crtc { · 690 unmodified lines
691691 struct timer_list disable_timer; /* delayed disable timer */
692692
693693 /* vblank counter, protected by dev->vblank_time_lock for writes */
694− unsigned long count;
694+ u32 count;
695695 /* vblank timestamps, protected by dev->vblank_time_lock for writes */
696696 struct timeval time[DRM_VBLANKTIME_RBSIZE];
697697