Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+25 -6
+1 -1
drivers/gpu/drm/drm_irq.c
··· 75 75 module_param_named(timestamp_monotonic, drm_timestamp_monotonic, int, 0600); 76 76 77 77 static void store_vblank(struct drm_device *dev, int crtc, 78 - unsigned vblank_count_inc, 78 + u32 vblank_count_inc, 79 79 struct timeval *t_vblank) 80 80 { 81 81 struct drm_vblank_crtc *vblank = &dev->vblank[crtc];
+23 -4
drivers/gpu/drm/i915/intel_bios.c
··· 1075 1075 const union child_device_config *p_child; 1076 1076 union child_device_config *child_dev_ptr; 1077 1077 int i, child_device_num, count; 1078 - u16 block_size; 1078 + u8 expected_size; 1079 + u16 block_size; 1079 1080 1080 1081 p_defs = find_section(bdb, BDB_GENERAL_DEFINITIONS); 1081 1082 if (!p_defs) { 1082 1083 DRM_DEBUG_KMS("No general definition block is found, no devices defined.\n"); 1083 1084 return; 1084 1085 } 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); 1087 1106 return; 1088 1107 } 1089 1108 /* get the block size of general definitions */ ··· 1149 1130 1150 1131 child_dev_ptr = dev_priv->vbt.child_dev + count; 1151 1132 count++; 1152 - memcpy(child_dev_ptr, p_child, sizeof(*p_child)); 1133 + memcpy(child_dev_ptr, p_child, p_defs->child_dev_size); 1153 1134 } 1154 1135 return; 1155 1136 }
+1 -1
include/drm/drmP.h
··· 691 691 struct timer_list disable_timer; /* delayed disable timer */ 692 692 693 693 /* vblank counter, protected by dev->vblank_time_lock for writes */ 694 - unsigned long count; 694 + u32 count; 695 695 /* vblank timestamps, protected by dev->vblank_time_lock for writes */ 696 696 struct timeval time[DRM_VBLANKTIME_RBSIZE]; 697 697