drm/i915: Add connector property to limit max bpc
Subsystems (2)
PATCH v2 1/2 drm/i915: Add connector property to limit max bpc
From: "Sripada, Radhakrishna" <[email protected]>
At times 12bpc HDMI cannot be driven due to faulty cables, dongles level shifters etc. To workaround them we may need to drive the output at a lower bpc. Currently the user space does not have a way to limit the bpc. The default bpc to be programmed is decided by the driver and is run against connector limitations.
Creating a new connector property "max bpc" in order to limit the bpc with which the pixels are scanned out. xrandr can make use of this connector property to make sure that bpc does not exceed the configured value.
V2: Initialize max_bpc to satisfy kms_properties
--- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_atomic.c | 7 +++++++ drivers/gpu/drm/i915/intel_drv.h | 2 ++ drivers/gpu/drm/i915/intel_hdmi.c | 11 +++++++++++ drivers/gpu/drm/i915/intel_modes.c | 19 +++++++++++++++++++ 5 files changed, 40 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +1 -0
@@ -2465,6 +2465,7 @@ struct drm_i915_private {struct drm_property *broadcast_rgb_property;struct drm_property *force_audio_property; +struct drm_property *max_bpc_property;/* hda/i915 audio component */ struct i915_audio_component *audio_component;
drivers/gpu/drm/i915/intel_atomic.c +7 -0
@@ -58,6 +58,8 @@ int intel_digital_connector_atomic_get_property(struct drm_connector *connector, *val = intel_conn_state->force_audio; else if (property == dev_priv->broadcast_rgb_property) *val = intel_conn_state->broadcast_rgb; + else if (property == dev_priv->max_bpc_property) + *val = intel_conn_state->max_bpc; else {DRM_DEBUG_ATOMIC ("Unknown property %s\n" , property->name);return -EINVAL ;
@@ -95,6 +97,11 @@ int intel_digital_connector_atomic_set_property(struct drm_connector *connector,return 0 ; } +if (property == dev_priv->max_bpc_property) { + intel_conn_state->max_bpc = val; +return 0 ; + } +DRM_DEBUG_ATOMIC ("Unknown property %s\n" , property->name);return -EINVAL ; }
drivers/gpu/drm/i915/intel_drv.h +2 -0
@@ -337,6 +337,7 @@ struct intel_digital_connector_state {enum hdmi_force_audio force_audio;int broadcast_rgb; +int max_bpc; };#define to_intel_digital_connector_state (x) container_of(x, struct intel_digital_connector_state, base)
@@ -1692,6 +1693,7 @@ int intel_ddc_get_modes(struct drm_connector *c, struct i2c_adapter *adapter);void intel_attach_force_audio_property (struct drm_connector *connector);void intel_attach_broadcast_rgb_property (struct drm_connector *connector);void intel_attach_aspect_ratio_property (struct drm_connector *connector); +void intel_attach_max_bpc_property (struct drm_connector *connector,int min,int max);/* intel_overlay.c */
drivers/gpu/drm/i915/intel_hdmi.c +11 -0
@@ -1795,10 +1795,21 @@ static const struct drm_encoder_funcs intel_hdmi_enc_funcs = {static void intel_hdmi_add_properties (struct intel_hdmi *intel_hdmi,struct drm_connector *connector) { +struct drm_i915_private *dev_priv =to_i915 (connector->dev); +intel_attach_force_audio_property (connector);intel_attach_broadcast_rgb_property (connector);intel_attach_aspect_ratio_property (connector); connector->state->picture_aspect_ratio =HDMI_PICTURE_ASPECT_NONE ; + +if ((IS_G4X (dev_priv) ||IS_VALLEYVIEW (dev_priv) || +IS_CHERRYVIEW (dev_priv))) { +intel_attach_max_bpc_property (connector,8 ,10 ); +to_intel_digital_connector_state (connector->state)->max_bpc =10 ; + }else if (INTEL_GEN (dev_priv) >=5 ) { +intel_attach_max_bpc_property (connector,8 ,12 ); +to_intel_digital_connector_state (connector->state)->max_bpc =12 ; + } }/*
drivers/gpu/drm/i915/intel_modes.c +19 -0
@@ -151,3 +151,22 @@ intel_attach_aspect_ratio_property(struct drm_connector *connector) connector->dev->mode_config.aspect_ratio_property, DRM_MODE_PICTURE_ASPECT_NONE); } + +void +intel_attach_max_bpc_property (struct drm_connector *connector,int min,int max) +{ +struct drm_device *dev = connector->dev; +struct drm_i915_private *dev_priv =to_i915 (dev); +struct drm_property *prop; + + prop = dev_priv->max_bpc_property; +if (prop ==NULL ) { + prop =drm_property_create_range (dev,0 ,"max bpc" , min, max); +if (prop ==NULL ) +return ; + + dev_priv->max_bpc_property = prop; + } + +drm_object_attach_property (&connector->base, prop, max); +}
Signature · 6 lines
2.9.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 2/2 drm/i915: Allow "max bpc" property to limit pipe_bpp
From: "Sripada, Radhakrishna" <[email protected]>
Use the newly added "max bpc" connector property to limit pipe bpp.
--- drivers/gpu/drm/i915/intel_display.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
drivers/gpu/drm/i915/intel_display.c +27 -0
@@ -10507,6 +10507,28 @@ connected_sink_compute_bpp(struct intel_connector *connector, } } +static void +connected_sink_max_bpp (struct intel_digital_connector_state *intel_conn_state, +struct intel_crtc_state *pipe_config) +{ +switch (intel_conn_state->max_bpc) { +case 8 : +case 9 : + pipe_config->pipe_bpp =8 *3 ; +break ; +case 10 : +case 11 : + pipe_config->pipe_bpp =10 *3 ; +break ; +case 12 : + pipe_config->pipe_bpp =12 *3 ; +break ; +default : +break ; + } +DRM_DEBUG_KMS ("Limiting display bpp to %d\n" , pipe_config->pipe_bpp); +} +static int compute_baseline_pipe_bpp (struct intel_crtc *crtc,struct intel_crtc_state *pipe_config)
@@ -10515,6 +10537,7 @@ compute_baseline_pipe_bpp(struct intel_crtc *crtc,struct drm_atomic_state *state;struct drm_connector *connector;struct drm_connector_state *connector_state; +struct intel_digital_connector_state *intel_conn_state;int bpp, i; if ((IS_G4X(dev_priv) || IS_VALLEYVIEW(dev_priv) ||
@@ -10535,6 +10558,10 @@ compute_baseline_pipe_bpp(struct intel_crtc *crtc,if (connector_state->crtc != &crtc->base)continue ; + intel_conn_state =to_intel_digital_connector_state (connector_state); +if (intel_conn_state->max_bpc) +connected_sink_max_bpp (intel_conn_state, pipe_config); +connected_sink_compute_bpp (to_intel_connector (connector), pipe_config); }
Signature · 6 lines
2.9.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: warning for series starting with [v2,1/2] drm/i915: Add connector property to limit max bpc
In reply to Radhakrishna Sripada== Series Details ==
== Series Details ==
Series: series starting with [v2,1/2] drm/i915: Add connector property to limit max bpc
URL : https://patchwork.freedesktop.org/series/32730/
State : warning
== Summary ==
Series 32730v1 series starting with [v2,1/2] drm/i915: Add connector property to limit max bpc
https://patchwork.freedesktop.org/api/1.0/series/32730/revisions/1/mbox/
Test gem_close_race:
Subgroup basic-process:
pass -> DMESG-WARN (fi-bsw-n3050)
Test prime_busy:
Subgroup basic-wait-after-default:
pass -> DMESG-WARN (fi-bsw-n3050)fi-bdw-5557u total:289 pass:268 dwarn:0 dfail:0 fail:0 skip:21 time:444s fi-bdw-gvtdvm total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:453s fi-blb-e6850 total:289 pass:223 dwarn:1 dfail:0 fail:0 skip:65 time:371s fi-bsw-n3050 total:289 pass:241 dwarn:2 dfail:0 fail:0 skip:46 time:535s fi-bwr-2160 total:289 pass:183 dwarn:0 dfail:0 fail:0 skip:106 time:263s fi-bxt-dsi total:289 pass:259 dwarn:0 dfail:0 fail:0 skip:30 time:506s fi-bxt-j4205 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:495s fi-byt-j1900 total:289 pass:253 dwarn:1 dfail:0 fail:0 skip:35 time:492s fi-byt-n2820 total:289 pass:249 dwarn:1 dfail:0 fail:0 skip:39 time:472s fi-cfl-s total:289 pass:253 dwarn:4 dfail:0 fail:0 skip:32 time:548s fi-cnl-y total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:608s fi-elk-e7500 total:289 pass:229 dwarn:0 dfail:0 fail:0 skip:60 time:418s fi-gdg-551 total:289 pass:178 dwarn:1 dfail:0 fail:1 skip:109 time:251s fi-glk-1 total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:578s fi-glk-dsi total:289 pass:258 dwarn:0 dfail:0 fail:1 skip:30 time:481s fi-hsw-4770 total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:427s fi-hsw-4770r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:430s fi-ilk-650 total:289 pass:228 dwarn:0 dfail:0 fail:0 skip:61 time:433s fi-ivb-3520m total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:492s fi-ivb-3770 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:458s fi-kbl-7500u total:289 pass:264 dwarn:1 dfail:0 fail:0 skip:24 time:487s fi-kbl-7560u total:289 pass:270 dwarn:0 dfail:0 fail:0 skip:19 time:573s fi-kbl-7567u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:474s fi-kbl-r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:582s fi-pnv-d510 total:289 pass:222 dwarn:1 dfail:0 fail:0 skip:66 time:545s fi-skl-6260u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:446s fi-skl-6600u total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:592s fi-skl-6700hq total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:655s fi-skl-6700k total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:518s fi-skl-6770hq total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:505s fi-skl-gvtdvm total:289 pass:266 dwarn:0 dfail:0 fail:0 skip:23 time:453s fi-snb-2520m total:289 pass:250 dwarn:0 dfail:0 fail:0 skip:39 time:558s fi-snb-2600 total:289 pass:249 dwarn:0 dfail:0 fail:0 skip:40 time:420s
ab2f0644893988b173763303a96b7213315b8acf drm-tip: 2017y-10m-26d-22h-25m-08s UTC integration manifest a29bac63a2f9 drm/i915: Allow "max bpc" property to limit pipe_bppcc5c31e4aee0 drm/i915: Add connector property to limit max bpc
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6220/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx