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-intel-fixes' of git://people.freedesktop.org/~keithp/linux

* 'drm-intel-fixes' of git://people.freedesktop.org/~keithp/linux:
drm/i915: FBC off for ironlake and older, otherwise on by default
drm/i915: Enable SDVO hotplug interrupts for HDMI and DVI
drm/i915: Enable dither whenever display bpc < frame buffer bpc

+47 -70
+2 -2
drivers/gpu/drm/i915/i915_drv.c
··· 67 67 MODULE_PARM_DESC(i915_enable_rc6, 68 68 "Enable power-saving render C-state 6 (default: true)"); 69 69 70 - unsigned int i915_enable_fbc __read_mostly = 1; 70 + unsigned int i915_enable_fbc __read_mostly = -1; 71 71 module_param_named(i915_enable_fbc, i915_enable_fbc, int, 0600); 72 72 MODULE_PARM_DESC(i915_enable_fbc, 73 73 "Enable frame buffer compression for power savings " 74 - "(default: false)"); 74 + "(default: -1 (use per-chip default))"); 75 75 76 76 unsigned int i915_lvds_downclock __read_mostly = 0; 77 77 module_param_named(lvds_downclock, i915_lvds_downclock, int, 0400);
+16 -6
drivers/gpu/drm/i915/intel_display.c
··· 1799 1799 struct drm_framebuffer *fb; 1800 1800 struct intel_framebuffer *intel_fb; 1801 1801 struct drm_i915_gem_object *obj; 1802 + int enable_fbc; 1802 1803 1803 1804 DRM_DEBUG_KMS("\n"); 1804 1805 ··· 1840 1839 intel_fb = to_intel_framebuffer(fb); 1841 1840 obj = intel_fb->obj; 1842 1841 1843 - if (!i915_enable_fbc) { 1844 - DRM_DEBUG_KMS("fbc disabled per module param (default off)\n"); 1842 + enable_fbc = i915_enable_fbc; 1843 + if (enable_fbc < 0) { 1844 + DRM_DEBUG_KMS("fbc set to per-chip default\n"); 1845 + enable_fbc = 1; 1846 + if (INTEL_INFO(dev)->gen <= 5) 1847 + enable_fbc = 0; 1848 + } 1849 + if (!enable_fbc) { 1850 + DRM_DEBUG_KMS("fbc disabled per module param\n"); 1845 1851 dev_priv->no_fbc_reason = FBC_MODULE_PARAM; 1846 1852 goto out_disable; 1847 1853 } ··· 4695 4687 bpc = 6; /* min is 18bpp */ 4696 4688 break; 4697 4689 case 24: 4698 - bpc = min((unsigned int)8, display_bpc); 4690 + bpc = 8; 4699 4691 break; 4700 4692 case 30: 4701 - bpc = min((unsigned int)10, display_bpc); 4693 + bpc = 10; 4702 4694 break; 4703 4695 case 48: 4704 - bpc = min((unsigned int)12, display_bpc); 4696 + bpc = 12; 4705 4697 break; 4706 4698 default: 4707 4699 DRM_DEBUG("unsupported depth, assuming 24 bits\n"); ··· 4709 4701 break; 4710 4702 } 4711 4703 4704 + display_bpc = min(display_bpc, bpc); 4705 + 4712 4706 DRM_DEBUG_DRIVER("setting pipe bpc to %d (max display bpc %d)\n", 4713 4707 bpc, display_bpc); 4714 4708 4715 - *pipe_bpp = bpc * 3; 4709 + *pipe_bpp = display_bpc * 3; 4716 4710 4717 4711 return display_bpc != bpc; 4718 4712 }
-3
drivers/gpu/drm/i915/intel_drv.h
··· 337 337 struct drm_connector *connector, 338 338 struct intel_load_detect_pipe *old); 339 339 340 - extern struct drm_connector* intel_sdvo_find(struct drm_device *dev, int sdvoB); 341 - extern int intel_sdvo_supports_hotplug(struct drm_connector *connector); 342 - extern void intel_sdvo_set_hotplug(struct drm_connector *connector, int enable); 343 340 extern void intelfb_restore(void); 344 341 extern void intel_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green, 345 342 u16 blue, int regno);
+29 -59
drivers/gpu/drm/i915/intel_sdvo.c
··· 92 92 */ 93 93 uint16_t attached_output; 94 94 95 + /* 96 + * Hotplug activation bits for this device 97 + */ 98 + uint8_t hotplug_active[2]; 99 + 95 100 /** 96 101 * This is used to select the color range of RBG outputs in HDMI mode. 97 102 * It is only valid when using TMDS encoding and 8 bit per color mode. ··· 1213 1208 return true; 1214 1209 } 1215 1210 1216 - /* No use! */ 1217 - #if 0 1218 - struct drm_connector* intel_sdvo_find(struct drm_device *dev, int sdvoB) 1219 - { 1220 - struct drm_connector *connector = NULL; 1221 - struct intel_sdvo *iout = NULL; 1222 - struct intel_sdvo *sdvo; 1223 - 1224 - /* find the sdvo connector */ 1225 - list_for_each_entry(connector, &dev->mode_config.connector_list, head) { 1226 - iout = to_intel_sdvo(connector); 1227 - 1228 - if (iout->type != INTEL_OUTPUT_SDVO) 1229 - continue; 1230 - 1231 - sdvo = iout->dev_priv; 1232 - 1233 - if (sdvo->sdvo_reg == SDVOB && sdvoB) 1234 - return connector; 1235 - 1236 - if (sdvo->sdvo_reg == SDVOC && !sdvoB) 1237 - return connector; 1238 - 1239 - } 1240 - 1241 - return NULL; 1242 - } 1243 - 1244 - int intel_sdvo_supports_hotplug(struct drm_connector *connector) 1211 + static int intel_sdvo_supports_hotplug(struct intel_sdvo *intel_sdvo) 1245 1212 { 1246 1213 u8 response[2]; 1247 - u8 status; 1248 - struct intel_sdvo *intel_sdvo; 1249 - DRM_DEBUG_KMS("\n"); 1250 - 1251 - if (!connector) 1252 - return 0; 1253 - 1254 - intel_sdvo = to_intel_sdvo(connector); 1255 1214 1256 1215 return intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_HOT_PLUG_SUPPORT, 1257 1216 &response, 2) && response[0]; 1258 1217 } 1259 1218 1260 - void intel_sdvo_set_hotplug(struct drm_connector *connector, int on) 1219 + static void intel_sdvo_enable_hotplug(struct intel_encoder *encoder) 1261 1220 { 1262 - u8 response[2]; 1263 - u8 status; 1264 - struct intel_sdvo *intel_sdvo = to_intel_sdvo(connector); 1221 + struct intel_sdvo *intel_sdvo = to_intel_sdvo(&encoder->base); 1265 1222 1266 - intel_sdvo_write_cmd(intel_sdvo, SDVO_CMD_GET_ACTIVE_HOT_PLUG, NULL, 0); 1267 - intel_sdvo_read_response(intel_sdvo, &response, 2); 1268 - 1269 - if (on) { 1270 - intel_sdvo_write_cmd(intel_sdvo, SDVO_CMD_GET_HOT_PLUG_SUPPORT, NULL, 0); 1271 - status = intel_sdvo_read_response(intel_sdvo, &response, 2); 1272 - 1273 - intel_sdvo_write_cmd(intel_sdvo, SDVO_CMD_SET_ACTIVE_HOT_PLUG, &response, 2); 1274 - } else { 1275 - response[0] = 0; 1276 - response[1] = 0; 1277 - intel_sdvo_write_cmd(intel_sdvo, SDVO_CMD_SET_ACTIVE_HOT_PLUG, &response, 2); 1278 - } 1279 - 1280 - intel_sdvo_write_cmd(intel_sdvo, SDVO_CMD_GET_ACTIVE_HOT_PLUG, NULL, 0); 1281 - intel_sdvo_read_response(intel_sdvo, &response, 2); 1223 + intel_sdvo_write_cmd(intel_sdvo, SDVO_CMD_SET_ACTIVE_HOT_PLUG, &intel_sdvo->hotplug_active, 2); 1282 1224 } 1283 - #endif 1284 1225 1285 1226 static bool 1286 1227 intel_sdvo_multifunc_encoder(struct intel_sdvo *intel_sdvo) ··· 1996 2045 { 1997 2046 struct drm_encoder *encoder = &intel_sdvo->base.base; 1998 2047 struct drm_connector *connector; 2048 + struct intel_encoder *intel_encoder = to_intel_encoder(encoder); 1999 2049 struct intel_connector *intel_connector; 2000 2050 struct intel_sdvo_connector *intel_sdvo_connector; 2001 2051 ··· 2014 2062 2015 2063 intel_connector = &intel_sdvo_connector->base; 2016 2064 connector = &intel_connector->base; 2017 - connector->polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT; 2065 + if (intel_sdvo_supports_hotplug(intel_sdvo) & (1 << device)) { 2066 + connector->polled = DRM_CONNECTOR_POLL_HPD; 2067 + intel_sdvo->hotplug_active[0] |= 1 << device; 2068 + /* Some SDVO devices have one-shot hotplug interrupts. 2069 + * Ensure that they get re-enabled when an interrupt happens. 2070 + */ 2071 + intel_encoder->hot_plug = intel_sdvo_enable_hotplug; 2072 + intel_sdvo_enable_hotplug(intel_encoder); 2073 + } 2074 + else 2075 + connector->polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT; 2018 2076 encoder->encoder_type = DRM_MODE_ENCODER_TMDS; 2019 2077 connector->connector_type = DRM_MODE_CONNECTOR_DVID; 2020 2078 ··· 2530 2568 /* In default case sdvo lvds is false */ 2531 2569 if (!intel_sdvo_get_capabilities(intel_sdvo, &intel_sdvo->caps)) 2532 2570 goto err; 2571 + 2572 + /* Set up hotplug command - note paranoia about contents of reply. 2573 + * We assume that the hardware is in a sane state, and only touch 2574 + * the bits we think we understand. 2575 + */ 2576 + intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_ACTIVE_HOT_PLUG, 2577 + &intel_sdvo->hotplug_active, 2); 2578 + intel_sdvo->hotplug_active[0] &= ~0x3; 2533 2579 2534 2580 if (intel_sdvo_output_setup(intel_sdvo, 2535 2581 intel_sdvo->caps.output_flags) != true) {