diff options
| -rw-r--r-- | drivers/gpu/drm/i915/i915_drv.c | 4 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 22 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/intel_drv.h | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/intel_sdvo.c | 88 |
4 files changed, 47 insertions, 70 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index ce045a8cf82c..f07e4252b708 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
| @@ -67,11 +67,11 @@ module_param_named(i915_enable_rc6, i915_enable_rc6, int, 0600); | |||
| 67 | MODULE_PARM_DESC(i915_enable_rc6, | 67 | MODULE_PARM_DESC(i915_enable_rc6, |
| 68 | "Enable power-saving render C-state 6 (default: true)"); | 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 | module_param_named(i915_enable_fbc, i915_enable_fbc, int, 0600); | 71 | module_param_named(i915_enable_fbc, i915_enable_fbc, int, 0600); |
| 72 | MODULE_PARM_DESC(i915_enable_fbc, | 72 | MODULE_PARM_DESC(i915_enable_fbc, |
| 73 | "Enable frame buffer compression for power savings " | 73 | "Enable frame buffer compression for power savings " |
| 74 | "(default: false)"); | 74 | "(default: -1 (use per-chip default))"); |
| 75 | 75 | ||
| 76 | unsigned int i915_lvds_downclock __read_mostly = 0; | 76 | unsigned int i915_lvds_downclock __read_mostly = 0; |
| 77 | module_param_named(lvds_downclock, i915_lvds_downclock, int, 0400); | 77 | module_param_named(lvds_downclock, i915_lvds_downclock, int, 0400); |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 56a8554d9039..04411ad2e779 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
| @@ -1799,6 +1799,7 @@ static void intel_update_fbc(struct drm_device *dev) | |||
| 1799 | struct drm_framebuffer *fb; | 1799 | struct drm_framebuffer *fb; |
| 1800 | struct intel_framebuffer *intel_fb; | 1800 | struct intel_framebuffer *intel_fb; |
| 1801 | struct drm_i915_gem_object *obj; | 1801 | struct drm_i915_gem_object *obj; |
| 1802 | int enable_fbc; | ||
| 1802 | 1803 | ||
| 1803 | DRM_DEBUG_KMS("\n"); | 1804 | DRM_DEBUG_KMS("\n"); |
| 1804 | 1805 | ||
| @@ -1839,8 +1840,15 @@ static void intel_update_fbc(struct drm_device *dev) | |||
| 1839 | intel_fb = to_intel_framebuffer(fb); | 1840 | intel_fb = to_intel_framebuffer(fb); |
| 1840 | obj = intel_fb->obj; | 1841 | obj = intel_fb->obj; |
| 1841 | 1842 | ||
| 1842 | if (!i915_enable_fbc) { | 1843 | enable_fbc = i915_enable_fbc; |
| 1843 | DRM_DEBUG_KMS("fbc disabled per module param (default off)\n"); | 1844 | if (enable_fbc < 0) { |
| 1845 | DRM_DEBUG_KMS("fbc set to per-chip default\n"); | ||
| 1846 | enable_fbc = 1; | ||
| 1847 | if (INTEL_INFO(dev)->gen <= 5) | ||
| 1848 | enable_fbc = 0; | ||
| 1849 | } | ||
| 1850 | if (!enable_fbc) { | ||
| 1851 | DRM_DEBUG_KMS("fbc disabled per module param\n"); | ||
| 1844 | dev_priv->no_fbc_reason = FBC_MODULE_PARAM; | 1852 | dev_priv->no_fbc_reason = FBC_MODULE_PARAM; |
| 1845 | goto out_disable; | 1853 | goto out_disable; |
| 1846 | } | 1854 | } |
| @@ -4687,13 +4695,13 @@ static bool intel_choose_pipe_bpp_dither(struct drm_crtc *crtc, | |||
| 4687 | bpc = 6; /* min is 18bpp */ | 4695 | bpc = 6; /* min is 18bpp */ |
| 4688 | break; | 4696 | break; |
| 4689 | case 24: | 4697 | case 24: |
| 4690 | bpc = min((unsigned int)8, display_bpc); | 4698 | bpc = 8; |
| 4691 | break; | 4699 | break; |
| 4692 | case 30: | 4700 | case 30: |
| 4693 | bpc = min((unsigned int)10, display_bpc); | 4701 | bpc = 10; |
| 4694 | break; | 4702 | break; |
| 4695 | case 48: | 4703 | case 48: |
| 4696 | bpc = min((unsigned int)12, display_bpc); | 4704 | bpc = 12; |
| 4697 | break; | 4705 | break; |
| 4698 | default: | 4706 | default: |
| 4699 | DRM_DEBUG("unsupported depth, assuming 24 bits\n"); | 4707 | DRM_DEBUG("unsupported depth, assuming 24 bits\n"); |
| @@ -4701,10 +4709,12 @@ static bool intel_choose_pipe_bpp_dither(struct drm_crtc *crtc, | |||
| 4701 | break; | 4709 | break; |
| 4702 | } | 4710 | } |
| 4703 | 4711 | ||
| 4712 | display_bpc = min(display_bpc, bpc); | ||
| 4713 | |||
| 4704 | DRM_DEBUG_DRIVER("setting pipe bpc to %d (max display bpc %d)\n", | 4714 | DRM_DEBUG_DRIVER("setting pipe bpc to %d (max display bpc %d)\n", |
| 4705 | bpc, display_bpc); | 4715 | bpc, display_bpc); |
| 4706 | 4716 | ||
| 4707 | *pipe_bpp = bpc * 3; | 4717 | *pipe_bpp = display_bpc * 3; |
| 4708 | 4718 | ||
| 4709 | return display_bpc != bpc; | 4719 | return display_bpc != bpc; |
| 4710 | } | 4720 | } |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 0b2ee9d39980..fe1099d8817e 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
| @@ -337,9 +337,6 @@ extern void intel_release_load_detect_pipe(struct intel_encoder *intel_encoder, | |||
| 337 | struct drm_connector *connector, | 337 | struct drm_connector *connector, |
| 338 | struct intel_load_detect_pipe *old); | 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 | extern void intelfb_restore(void); | 340 | extern void intelfb_restore(void); |
| 344 | extern void intel_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green, | 341 | extern void intel_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green, |
| 345 | u16 blue, int regno); | 342 | u16 blue, int regno); |
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index 30fe554d8936..6348c499616f 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
| @@ -92,6 +92,11 @@ struct intel_sdvo { | |||
| 92 | */ | 92 | */ |
| 93 | uint16_t attached_output; | 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 | * This is used to select the color range of RBG outputs in HDMI mode. | 101 | * This is used to select the color range of RBG outputs in HDMI mode. |
| 97 | * It is only valid when using TMDS encoding and 8 bit per color mode. | 102 | * It is only valid when using TMDS encoding and 8 bit per color mode. |
| @@ -1208,74 +1213,20 @@ static bool intel_sdvo_get_capabilities(struct intel_sdvo *intel_sdvo, struct in | |||
| 1208 | return true; | 1213 | return true; |
| 1209 | } | 1214 | } |
| 1210 | 1215 | ||
| 1211 | /* No use! */ | 1216 | static int intel_sdvo_supports_hotplug(struct intel_sdvo *intel_sdvo) |
| 1212 | #if 0 | ||
| 1213 | struct drm_connector* intel_sdvo_find(struct drm_device *dev, int sdvoB) | ||
| 1214 | { | ||
| 1215 | struct drm_connector *connector = NULL; | ||
| 1216 | struct intel_sdvo *iout = NULL; | ||
| 1217 | struct intel_sdvo *sdvo; | ||
| 1218 | |||
| 1219 | /* find the sdvo connector */ | ||
| 1220 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { | ||
| 1221 | iout = to_intel_sdvo(connector); | ||
| 1222 | |||
| 1223 | if (iout->type != INTEL_OUTPUT_SDVO) | ||
| 1224 | continue; | ||
| 1225 | |||
| 1226 | sdvo = iout->dev_priv; | ||
| 1227 | |||
| 1228 | if (sdvo->sdvo_reg == SDVOB && sdvoB) | ||
| 1229 | return connector; | ||
| 1230 | |||
| 1231 | if (sdvo->sdvo_reg == SDVOC && !sdvoB) | ||
| 1232 | return connector; | ||
| 1233 | |||
| 1234 | } | ||
| 1235 | |||
| 1236 | return NULL; | ||
| 1237 | } | ||
| 1238 | |||
| 1239 | int intel_sdvo_supports_hotplug(struct drm_connector *connector) | ||
| 1240 | { | 1217 | { |
| 1241 | u8 response[2]; | 1218 | u8 response[2]; |
| 1242 | u8 status; | ||
| 1243 | struct intel_sdvo *intel_sdvo; | ||
| 1244 | DRM_DEBUG_KMS("\n"); | ||
| 1245 | |||
| 1246 | if (!connector) | ||
| 1247 | return 0; | ||
| 1248 | |||
| 1249 | intel_sdvo = to_intel_sdvo(connector); | ||
| 1250 | 1219 | ||
| 1251 | return intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_HOT_PLUG_SUPPORT, | 1220 | return intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_HOT_PLUG_SUPPORT, |
| 1252 | &response, 2) && response[0]; | 1221 | &response, 2) && response[0]; |
| 1253 | } | 1222 | } |
| 1254 | 1223 | ||
| 1255 | void intel_sdvo_set_hotplug(struct drm_connector *connector, int on) | 1224 | static void intel_sdvo_enable_hotplug(struct intel_encoder *encoder) |
| 1256 | { | 1225 | { |
| 1257 | u8 response[2]; | 1226 | struct intel_sdvo *intel_sdvo = to_intel_sdvo(&encoder->base); |
| 1258 | u8 status; | ||
| 1259 | struct intel_sdvo *intel_sdvo = to_intel_sdvo(connector); | ||
| 1260 | |||
| 1261 | intel_sdvo_write_cmd(intel_sdvo, SDVO_CMD_GET_ACTIVE_HOT_PLUG, NULL, 0); | ||
| 1262 | intel_sdvo_read_response(intel_sdvo, &response, 2); | ||
| 1263 | |||
| 1264 | if (on) { | ||
| 1265 | intel_sdvo_write_cmd(intel_sdvo, SDVO_CMD_GET_HOT_PLUG_SUPPORT, NULL, 0); | ||
| 1266 | status = intel_sdvo_read_response(intel_sdvo, &response, 2); | ||
| 1267 | |||
| 1268 | intel_sdvo_write_cmd(intel_sdvo, SDVO_CMD_SET_ACTIVE_HOT_PLUG, &response, 2); | ||
| 1269 | } else { | ||
| 1270 | response[0] = 0; | ||
| 1271 | response[1] = 0; | ||
| 1272 | intel_sdvo_write_cmd(intel_sdvo, SDVO_CMD_SET_ACTIVE_HOT_PLUG, &response, 2); | ||
| 1273 | } | ||
| 1274 | 1227 | ||
| 1275 | intel_sdvo_write_cmd(intel_sdvo, SDVO_CMD_GET_ACTIVE_HOT_PLUG, NULL, 0); | 1228 | intel_sdvo_write_cmd(intel_sdvo, SDVO_CMD_SET_ACTIVE_HOT_PLUG, &intel_sdvo->hotplug_active, 2); |
| 1276 | intel_sdvo_read_response(intel_sdvo, &response, 2); | ||
| 1277 | } | 1229 | } |
| 1278 | #endif | ||
| 1279 | 1230 | ||
| 1280 | static bool | 1231 | static bool |
| 1281 | intel_sdvo_multifunc_encoder(struct intel_sdvo *intel_sdvo) | 1232 | intel_sdvo_multifunc_encoder(struct intel_sdvo *intel_sdvo) |
| @@ -2045,6 +1996,7 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device) | |||
| 2045 | { | 1996 | { |
| 2046 | struct drm_encoder *encoder = &intel_sdvo->base.base; | 1997 | struct drm_encoder *encoder = &intel_sdvo->base.base; |
| 2047 | struct drm_connector *connector; | 1998 | struct drm_connector *connector; |
| 1999 | struct intel_encoder *intel_encoder = to_intel_encoder(encoder); | ||
| 2048 | struct intel_connector *intel_connector; | 2000 | struct intel_connector *intel_connector; |
| 2049 | struct intel_sdvo_connector *intel_sdvo_connector; | 2001 | struct intel_sdvo_connector *intel_sdvo_connector; |
| 2050 | 2002 | ||
| @@ -2062,7 +2014,17 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device) | |||
| 2062 | 2014 | ||
| 2063 | intel_connector = &intel_sdvo_connector->base; | 2015 | intel_connector = &intel_sdvo_connector->base; |
| 2064 | connector = &intel_connector->base; | 2016 | connector = &intel_connector->base; |
| 2065 | connector->polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT; | 2017 | if (intel_sdvo_supports_hotplug(intel_sdvo) & (1 << device)) { |
| 2018 | connector->polled = DRM_CONNECTOR_POLL_HPD; | ||
| 2019 | intel_sdvo->hotplug_active[0] |= 1 << device; | ||
| 2020 | /* Some SDVO devices have one-shot hotplug interrupts. | ||
| 2021 | * Ensure that they get re-enabled when an interrupt happens. | ||
| 2022 | */ | ||
| 2023 | intel_encoder->hot_plug = intel_sdvo_enable_hotplug; | ||
| 2024 | intel_sdvo_enable_hotplug(intel_encoder); | ||
| 2025 | } | ||
| 2026 | else | ||
| 2027 | connector->polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT; | ||
| 2066 | encoder->encoder_type = DRM_MODE_ENCODER_TMDS; | 2028 | encoder->encoder_type = DRM_MODE_ENCODER_TMDS; |
| 2067 | connector->connector_type = DRM_MODE_CONNECTOR_DVID; | 2029 | connector->connector_type = DRM_MODE_CONNECTOR_DVID; |
| 2068 | 2030 | ||
| @@ -2569,6 +2531,14 @@ bool intel_sdvo_init(struct drm_device *dev, int sdvo_reg) | |||
| 2569 | if (!intel_sdvo_get_capabilities(intel_sdvo, &intel_sdvo->caps)) | 2531 | if (!intel_sdvo_get_capabilities(intel_sdvo, &intel_sdvo->caps)) |
| 2570 | goto err; | 2532 | goto err; |
| 2571 | 2533 | ||
| 2534 | /* Set up hotplug command - note paranoia about contents of reply. | ||
| 2535 | * We assume that the hardware is in a sane state, and only touch | ||
| 2536 | * the bits we think we understand. | ||
| 2537 | */ | ||
| 2538 | intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_ACTIVE_HOT_PLUG, | ||
| 2539 | &intel_sdvo->hotplug_active, 2); | ||
| 2540 | intel_sdvo->hotplug_active[0] &= ~0x3; | ||
| 2541 | |||
| 2572 | if (intel_sdvo_output_setup(intel_sdvo, | 2542 | if (intel_sdvo_output_setup(intel_sdvo, |
| 2573 | intel_sdvo->caps.output_flags) != true) { | 2543 | intel_sdvo->caps.output_flags) != true) { |
| 2574 | DRM_DEBUG_KMS("SDVO output failed to setup on SDVO%c\n", | 2544 | DRM_DEBUG_KMS("SDVO output failed to setup on SDVO%c\n", |
