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

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6

* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
drm: ignore EDID with really tiny modes.
drm: don't associate _DRM_DRIVER maps with a master
drm/i915: intel_lvds.c fix section mismatch
drm: Hook up DPMS property handling in drm_crtc.c. Add drm_helper_connector_dpms.
drm: set permissions on edid file to 0444
drm: add newlines to text sysfs files
drm/radeon: fix ring free alignment calculations
drm: fix irq naming for kms drivers.

+151 -32
+2 -1
drivers/gpu/drm/drm_bufs.c
··· 371 371 list->user_token = list->hash.key << PAGE_SHIFT; 372 372 mutex_unlock(&dev->struct_mutex); 373 373 374 - list->master = dev->primary->master; 374 + if (!(map->flags & _DRM_DRIVER)) 375 + list->master = dev->primary->master; 375 376 *maplist = list; 376 377 return 0; 377 378 }
+6 -1
drivers/gpu/drm/drm_crtc.c
··· 2294 2294 } 2295 2295 } 2296 2296 2297 - if (connector->funcs->set_property) 2297 + /* Do DPMS ourselves */ 2298 + if (property == connector->dev->mode_config.dpms_property) { 2299 + if (connector->funcs->dpms) 2300 + (*connector->funcs->dpms)(connector, (int) out_resp->value); 2301 + ret = 0; 2302 + } else if (connector->funcs->set_property) 2298 2303 ret = connector->funcs->set_property(connector, property, out_resp->value); 2299 2304 2300 2305 /* store the property value if succesful */
+107 -2
drivers/gpu/drm/drm_crtc_helper.c
··· 199 199 } 200 200 201 201 /** 202 + * drm_helper_encoder_in_use - check if a given encoder is in use 203 + * @encoder: encoder to check 204 + * 205 + * LOCKING: 206 + * Caller must hold mode config lock. 207 + * 208 + * Walk @encoders's DRM device's mode_config and see if it's in use. 209 + * 210 + * RETURNS: 211 + * True if @encoder is part of the mode_config, false otherwise. 212 + */ 213 + bool drm_helper_encoder_in_use(struct drm_encoder *encoder) 214 + { 215 + struct drm_connector *connector; 216 + struct drm_device *dev = encoder->dev; 217 + list_for_each_entry(connector, &dev->mode_config.connector_list, head) 218 + if (connector->encoder == encoder) 219 + return true; 220 + return false; 221 + } 222 + EXPORT_SYMBOL(drm_helper_encoder_in_use); 223 + 224 + /** 202 225 * drm_helper_crtc_in_use - check if a given CRTC is in a mode_config 203 226 * @crtc: CRTC to check 204 227 * ··· 239 216 struct drm_device *dev = crtc->dev; 240 217 /* FIXME: Locking around list access? */ 241 218 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) 242 - if (encoder->crtc == crtc) 219 + if (encoder->crtc == crtc && drm_helper_encoder_in_use(encoder)) 243 220 return true; 244 221 return false; 245 222 } ··· 263 240 264 241 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { 265 242 encoder_funcs = encoder->helper_private; 266 - if (!encoder->crtc) 243 + if (!drm_helper_encoder_in_use(encoder)) 267 244 (*encoder_funcs->dpms)(encoder, DRM_MODE_DPMS_OFF); 268 245 } 269 246 ··· 957 934 return 0; 958 935 } 959 936 EXPORT_SYMBOL(drm_helper_initial_config); 937 + 938 + static int drm_helper_choose_encoder_dpms(struct drm_encoder *encoder) 939 + { 940 + int dpms = DRM_MODE_DPMS_OFF; 941 + struct drm_connector *connector; 942 + struct drm_device *dev = encoder->dev; 943 + 944 + list_for_each_entry(connector, &dev->mode_config.connector_list, head) 945 + if (connector->encoder == encoder) 946 + if (connector->dpms < dpms) 947 + dpms = connector->dpms; 948 + return dpms; 949 + } 950 + 951 + static int drm_helper_choose_crtc_dpms(struct drm_crtc *crtc) 952 + { 953 + int dpms = DRM_MODE_DPMS_OFF; 954 + struct drm_connector *connector; 955 + struct drm_device *dev = crtc->dev; 956 + 957 + list_for_each_entry(connector, &dev->mode_config.connector_list, head) 958 + if (connector->encoder && connector->encoder->crtc == crtc) 959 + if (connector->dpms < dpms) 960 + dpms = connector->dpms; 961 + return dpms; 962 + } 963 + 964 + /** 965 + * drm_helper_connector_dpms 966 + * @connector affected connector 967 + * @mode DPMS mode 968 + * 969 + * Calls the low-level connector DPMS function, then 970 + * calls appropriate encoder and crtc DPMS functions as well 971 + */ 972 + void drm_helper_connector_dpms(struct drm_connector *connector, int mode) 973 + { 974 + struct drm_encoder *encoder = connector->encoder; 975 + struct drm_crtc *crtc = encoder ? encoder->crtc : NULL; 976 + int old_dpms; 977 + 978 + if (mode == connector->dpms) 979 + return; 980 + 981 + old_dpms = connector->dpms; 982 + connector->dpms = mode; 983 + 984 + /* from off to on, do crtc then encoder */ 985 + if (mode < old_dpms) { 986 + if (crtc) { 987 + struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; 988 + if (crtc_funcs->dpms) 989 + (*crtc_funcs->dpms) (crtc, 990 + drm_helper_choose_crtc_dpms(crtc)); 991 + } 992 + if (encoder) { 993 + struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private; 994 + if (encoder_funcs->dpms) 995 + (*encoder_funcs->dpms) (encoder, 996 + drm_helper_choose_encoder_dpms(encoder)); 997 + } 998 + } 999 + 1000 + /* from on to off, do encoder then crtc */ 1001 + if (mode > old_dpms) { 1002 + if (encoder) { 1003 + struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private; 1004 + if (encoder_funcs->dpms) 1005 + (*encoder_funcs->dpms) (encoder, 1006 + drm_helper_choose_encoder_dpms(encoder)); 1007 + } 1008 + if (crtc) { 1009 + struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; 1010 + if (crtc_funcs->dpms) 1011 + (*crtc_funcs->dpms) (crtc, 1012 + drm_helper_choose_crtc_dpms(crtc)); 1013 + } 1014 + } 1015 + 1016 + return; 1017 + } 1018 + EXPORT_SYMBOL(drm_helper_connector_dpms); 960 1019 961 1020 /** 962 1021 * drm_hotplug_stage_two
+5
drivers/gpu/drm/drm_edid.c
··· 289 289 struct drm_display_mode *mode; 290 290 struct detailed_pixel_timing *pt = &timing->data.pixel_data; 291 291 292 + /* ignore tiny modes */ 293 + if (((pt->hactive_hi << 8) | pt->hactive_lo) < 64 || 294 + ((pt->vactive_hi << 8) | pt->hactive_lo) < 64) 295 + return NULL; 296 + 292 297 if (pt->stereo) { 293 298 printk(KERN_WARNING "stereo mode not supported\n"); 294 299 return NULL;
+7 -1
drivers/gpu/drm/drm_irq.c
··· 196 196 { 197 197 int ret = 0; 198 198 unsigned long sh_flags = 0; 199 + char *irqname; 199 200 200 201 if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ)) 201 202 return -EINVAL; ··· 228 227 if (drm_core_check_feature(dev, DRIVER_IRQ_SHARED)) 229 228 sh_flags = IRQF_SHARED; 230 229 230 + if (dev->devname) 231 + irqname = dev->devname; 232 + else 233 + irqname = dev->driver->name; 234 + 231 235 ret = request_irq(drm_dev_to_irq(dev), dev->driver->irq_handler, 232 - sh_flags, dev->devname, dev); 236 + sh_flags, irqname, dev); 233 237 234 238 if (ret < 0) { 235 239 mutex_lock(&dev->struct_mutex);
+4 -3
drivers/gpu/drm/drm_sysfs.c
··· 147 147 enum drm_connector_status status; 148 148 149 149 status = connector->funcs->detect(connector); 150 - return snprintf(buf, PAGE_SIZE, "%s", 150 + return snprintf(buf, PAGE_SIZE, "%s\n", 151 151 drm_get_connector_status_name(status)); 152 152 } 153 153 ··· 166 166 if (ret) 167 167 return 0; 168 168 169 - return snprintf(buf, PAGE_SIZE, "%s", 169 + return snprintf(buf, PAGE_SIZE, "%s\n", 170 170 drm_get_dpms_name((int)dpms_status)); 171 171 } 172 172 ··· 176 176 { 177 177 struct drm_connector *connector = to_drm_connector(device); 178 178 179 - return snprintf(buf, PAGE_SIZE, connector->encoder ? "enabled" : 179 + return snprintf(buf, PAGE_SIZE, "%s\n", connector->encoder ? "enabled" : 180 180 "disabled"); 181 181 } 182 182 ··· 317 317 318 318 static struct bin_attribute edid_attr = { 319 319 .attr.name = "edid", 320 + .attr.mode = 0444, 320 321 .size = 128, 321 322 .read = edid_show, 322 323 };
+2 -10
drivers/gpu/drm/i915/i915_dma.c
··· 987 987 int fb_bar = IS_I9XX(dev) ? 2 : 0; 988 988 int ret = 0; 989 989 990 - dev->devname = kstrdup(DRIVER_NAME, GFP_KERNEL); 991 - if (!dev->devname) { 992 - ret = -ENOMEM; 993 - goto out; 994 - } 995 - 996 990 dev->mode_config.fb_base = drm_get_resource_start(dev, fb_bar) & 997 991 0xff000000; 998 992 ··· 1000 1006 1001 1007 ret = i915_probe_agp(dev, &agp_size, &prealloc_size); 1002 1008 if (ret) 1003 - goto kfree_devname; 1009 + goto out; 1004 1010 1005 1011 /* Basic memrange allocator for stolen space (aka vram) */ 1006 1012 drm_mm_init(&dev_priv->vram, 0, prealloc_size); ··· 1018 1024 1019 1025 ret = i915_gem_init_ringbuffer(dev); 1020 1026 if (ret) 1021 - goto kfree_devname; 1027 + goto out; 1022 1028 1023 1029 /* Allow hardware batchbuffers unless told otherwise. 1024 1030 */ ··· 1050 1056 1051 1057 destroy_ringbuffer: 1052 1058 i915_gem_cleanup_ringbuffer(dev); 1053 - kfree_devname: 1054 - kfree(dev->devname); 1055 1059 out: 1056 1060 return ret; 1057 1061 }
+1 -5
drivers/gpu/drm/i915/intel_crt.c
··· 381 381 struct drm_property *property, 382 382 uint64_t value) 383 383 { 384 - struct drm_device *dev = connector->dev; 385 - 386 - if (property == dev->mode_config.dpms_property && connector->encoder) 387 - intel_crt_dpms(connector->encoder, (uint32_t)(value & 0xf)); 388 - 389 384 return 0; 390 385 } 391 386 ··· 397 402 }; 398 403 399 404 static const struct drm_connector_funcs intel_crt_connector_funcs = { 405 + .dpms = drm_helper_connector_dpms, 400 406 .detect = intel_crt_detect, 401 407 .fill_modes = drm_helper_probe_single_connector_modes, 402 408 .destroy = intel_crt_destroy,
+1
drivers/gpu/drm/i915/intel_dvo.c
··· 316 316 }; 317 317 318 318 static const struct drm_connector_funcs intel_dvo_connector_funcs = { 319 + .dpms = drm_helper_connector_dpms, 319 320 .save = intel_dvo_save, 320 321 .restore = intel_dvo_restore, 321 322 .detect = intel_dvo_detect,
+1
drivers/gpu/drm/i915/intel_hdmi.c
··· 219 219 }; 220 220 221 221 static const struct drm_connector_funcs intel_hdmi_connector_funcs = { 222 + .dpms = drm_helper_connector_dpms, 222 223 .save = intel_hdmi_save, 223 224 .restore = intel_hdmi_restore, 224 225 .detect = intel_hdmi_detect,
+2 -6
drivers/gpu/drm/i915/intel_lvds.c
··· 343 343 struct drm_property *property, 344 344 uint64_t value) 345 345 { 346 - struct drm_device *dev = connector->dev; 347 - 348 - if (property == dev->mode_config.dpms_property && connector->encoder) 349 - intel_lvds_dpms(connector->encoder, (uint32_t)(value & 0xf)); 350 - 351 346 return 0; 352 347 } 353 348 ··· 361 366 }; 362 367 363 368 static const struct drm_connector_funcs intel_lvds_connector_funcs = { 369 + .dpms = drm_helper_connector_dpms, 364 370 .save = intel_lvds_save, 365 371 .restore = intel_lvds_restore, 366 372 .detect = intel_lvds_detect, ··· 387 391 } 388 392 389 393 /* These systems claim to have LVDS, but really don't */ 390 - static const struct dmi_system_id __initdata intel_no_lvds[] = { 394 + static const struct dmi_system_id intel_no_lvds[] = { 391 395 { 392 396 .callback = intel_no_lvds_dmi_callback, 393 397 .ident = "Apple Mac Mini (Core series)",
+1
drivers/gpu/drm/i915/intel_sdvo.c
··· 1616 1616 }; 1617 1617 1618 1618 static const struct drm_connector_funcs intel_sdvo_connector_funcs = { 1619 + .dpms = drm_helper_connector_dpms, 1619 1620 .save = intel_sdvo_save, 1620 1621 .restore = intel_sdvo_restore, 1621 1622 .detect = intel_sdvo_detect,
+1
drivers/gpu/drm/i915/intel_tv.c
··· 1626 1626 }; 1627 1627 1628 1628 static const struct drm_connector_funcs intel_tv_connector_funcs = { 1629 + .dpms = drm_helper_connector_dpms, 1629 1630 .save = intel_tv_save, 1630 1631 .restore = intel_tv_restore, 1631 1632 .detect = intel_tv_detect,
+2 -2
drivers/gpu/drm/radeon/radeon_cp.c
··· 2185 2185 2186 2186 /* check if the ring is padded out to 16-dword alignment */ 2187 2187 2188 - tail_aligned = dev_priv->ring.tail & 0xf; 2188 + tail_aligned = dev_priv->ring.tail & (RADEON_RING_ALIGN-1); 2189 2189 if (tail_aligned) { 2190 - int num_p2 = 16 - tail_aligned; 2190 + int num_p2 = RADEON_RING_ALIGN - tail_aligned; 2191 2191 2192 2192 ring = dev_priv->ring.start; 2193 2193 /* pad with some CP_PACKET2 */
+4 -1
drivers/gpu/drm/radeon/radeon_drv.h
··· 1964 1964 1965 1965 #define RING_LOCALS int write, _nr, _align_nr; unsigned int mask; u32 *ring; 1966 1966 1967 + #define RADEON_RING_ALIGN 16 1968 + 1967 1969 #define BEGIN_RING( n ) do { \ 1968 1970 if ( RADEON_VERBOSE ) { \ 1969 1971 DRM_INFO( "BEGIN_RING( %d )\n", (n)); \ 1970 1972 } \ 1971 - _align_nr = (n + 0xf) & ~0xf; \ 1973 + _align_nr = RADEON_RING_ALIGN - ((dev_priv->ring.tail + n) & (RADEON_RING_ALIGN-1)); \ 1974 + _align_nr += n; \ 1972 1975 if (dev_priv->ring.space <= (_align_nr * sizeof(u32))) { \ 1973 1976 COMMIT_RING(); \ 1974 1977 radeon_wait_ring( dev_priv, _align_nr * sizeof(u32)); \
+3
include/drm/drm_crtc.h
··· 471 471 u32 property_ids[DRM_CONNECTOR_MAX_PROPERTY]; 472 472 uint64_t property_values[DRM_CONNECTOR_MAX_PROPERTY]; 473 473 474 + /* requested DPMS state */ 475 + int dpms; 476 + 474 477 void *helper_private; 475 478 476 479 uint32_t encoder_ids[DRM_CONNECTOR_MAX_ENCODER];
+2
include/drm/drm_crtc_helper.h
··· 99 99 struct drm_framebuffer *old_fb); 100 100 extern bool drm_helper_crtc_in_use(struct drm_crtc *crtc); 101 101 102 + extern void drm_helper_connector_dpms(struct drm_connector *connector, int mode); 103 + 102 104 extern int drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb, 103 105 struct drm_mode_fb_cmd *mode_cmd); 104 106