drm: Add connector property to limit max bpc
Subsystems (3)
PATCH v5 1/2 drm: Add connector property to limit max bpc
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. xrandr can make use of this connector property to make sure that bpc does not exceed the configured value. This property can be used by userspace to set the bpc.
V2: Initialize max_bpc to satisfy kms_properties
V3: Move the property to drm_connector
V4: Split drm and i915 components(Ville)
V5: Make the property per connector(Ville)
--- drivers/gpu/drm/drm_atomic.c | 4 ++++ drivers/gpu/drm/drm_atomic_helper.c | 4 ++++ include/drm/drm_connector.h | 12 ++++++++++++ 3 files changed, 20 insertions(+)
drivers/gpu/drm/drm_atomic.c +4 -0
@@ -1420,6 +1420,8 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector,return set_out_fence_for_connector (state->state, connector, fence_ptr); + }else if (property == connector->max_bpc_property) { + state->max_bpc = val; }else if (connector->funcs->atomic_set_property) {return connector->funcs->atomic_set_property (connector, state, property, val);
@@ -1515,6 +1517,8 @@ drm_atomic_connector_get_property(struct drm_connector *connector, *val =0 ; }else if (property == config->writeback_out_fence_ptr_property) { *val =0 ; + }else if (property == connector->max_bpc_property) { + *val = state->max_bpc; }else if (connector->funcs->atomic_get_property) {return connector->funcs->atomic_get_property (connector, state, property, val);
drivers/gpu/drm/drm_atomic_helper.c +4 -0
@@ -638,6 +638,10 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,if (old_connector_state->link_status != new_connector_state->link_status) new_crtc_state->connectors_changed = true; + +if (old_connector_state->max_bpc != + new_connector_state->max_bpc) + new_crtc_state->connectors_changed = true; }if (funcs->atomic_check)
include/drm/drm_connector.h +12 -0
@@ -460,6 +460,12 @@ struct drm_connector_state {* drm_writeback_signal_completion() */ struct drm_writeback_job *writeback_job; + +/** +* @max_bpc: Connector property to limit the maximum bit depth of +* the pixels. +*/ +unsigned int max_bpc; };/**
@@ -923,6 +929,12 @@ struct drm_connector {*/ struct drm_property_blob *path_blob_ptr; +/** +* @max_bpc_property: Default connector property for the max bpc to be +* driven out of the connector. +*/ +struct drm_property *max_bpc_property; +#define DRM_CONNECTOR_POLL_HPD (1 << 0)#define DRM_CONNECTOR_POLL_CONNECT (1 << 1)#define DRM_CONNECTOR_POLL_DISCONNECT (1 << 2)
Signature · 6 lines
2.9.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v5 2/2 drm/i915: Allow "max bpc" property to limit pipe_bpp
Use the newly added "max bpc" connector property to limit pipe bpp.
V3: Use drm_connector_state to access the "max bpc" property
V4: Initialize the drm property, add suuport to DP(Ville)
V5: Use the property in the connector and fix CI failure(Ville)
--- drivers/gpu/drm/i915/intel_display.c | 31 +++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_dp.c | 1 + drivers/gpu/drm/i915/intel_drv.h | 2 ++ drivers/gpu/drm/i915/intel_hdmi.c | 7 +++++++ drivers/gpu/drm/i915/intel_modes.c | 20 ++++++++++++++++++++ 5 files changed, 61 insertions(+)
drivers/gpu/drm/i915/intel_display.c +31 -0
@@ -10787,6 +10787,34 @@ connected_sink_compute_bpp(struct intel_connector *connector, } } +static void +connected_sink_max_bpp (struct drm_connector_state *conn_state, +struct intel_crtc_state *pipe_config) +{ +switch (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 : +case 13 : +case 14 : +case 15 : + pipe_config->pipe_bpp =12 *3 ; +break ; +case 16 : + pipe_config->pipe_bpp =16 *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)
@@ -10815,6 +10843,9 @@ compute_baseline_pipe_bpp(struct intel_crtc *crtc,if (connector_state->crtc != &crtc->base)continue ; +if (connector_state->max_bpc) +connected_sink_max_bpp (connector_state, pipe_config); +connected_sink_compute_bpp (to_intel_connector (connector), pipe_config); }
drivers/gpu/drm/i915/intel_dp.c +1 -0
@@ -5719,6 +5719,7 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connectintel_attach_force_audio_property (connector);intel_attach_broadcast_rgb_property (connector); +intel_attach_max_bpc_property (connector,8 ,16 );if (intel_dp_is_edp (intel_dp)) {u32 allowed_scalers;
drivers/gpu/drm/i915/intel_drv.h +2 -0
@@ -1869,6 +1869,8 @@ 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 +7 -0
@@ -2109,11 +2109,18 @@ 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);drm_connector_attach_content_type_property (connector); connector->state->picture_aspect_ratio =HDMI_PICTURE_ASPECT_NONE ; + +if (HAS_GMCH_DISPLAY (dev_priv)) +intel_attach_max_bpc_property (connector,8 ,8 ); +else +intel_attach_max_bpc_property (connector,8 ,12 ); }/*
drivers/gpu/drm/i915/intel_modes.c +20 -0
@@ -133,3 +133,23 @@ 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_property *prop; + + prop = connector->max_bpc_property; +if (prop ==NULL ) { + prop =drm_property_create_range (dev,0 ,"max bpc" , min, max); +if (prop ==NULL ) +return ; + + connector->max_bpc_property = prop; + } + +drm_object_attach_property (&connector->base, prop, max); + connector->state->max_bpc = max; +}
Signature · 6 lines
2.9.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.CHECKPATCH: warning for series starting with [v5,1/2] drm: Add connector property to limit max bpc
In reply to Radhakrishna Sripada== Series Details ==
== Series Details ==
Series: series starting with [v5,1/2] drm: Add connector property to limit max bpc
URL : https://patchwork.freedesktop.org/series/49230/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip 2c48291891eb drm: Add connector property to limit max bpc 44f00038f508 drm/i915: Allow "max bpc" property to limit pipe_bpp -:32: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #32: FILE: drivers/gpu/drm/i915/intel_display.c:10792: +connected_sink_max_bpp(struct drm_connector_state *conn_state, + struct intel_crtc_state *pipe_config)
-:37: CHECK:SPACING: spaces preferred around that '*' (ctx:VxV) #37: FILE: drivers/gpu/drm/i915/intel_display.c:10797:
+ pipe_config->pipe_bpp = 8*3;
^
-:41: CHECK:SPACING: spaces preferred around that '*' (ctx:VxV) #41: FILE: drivers/gpu/drm/i915/intel_display.c:10801:
+ pipe_config->pipe_bpp = 10*3;
^
-:47: CHECK:SPACING: spaces preferred around that '*' (ctx:VxV) #47: FILE: drivers/gpu/drm/i915/intel_display.c:10807:
+ pipe_config->pipe_bpp = 12*3;
^
-:50: CHECK:SPACING: spaces preferred around that '*' (ctx:VxV) #50: FILE: drivers/gpu/drm/i915/intel_display.c:10810:
+ pipe_config->pipe_bpp = 16*3;
^
-:136: CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written "!prop" #136: FILE: drivers/gpu/drm/i915/intel_modes.c:145:
+ if (prop == NULL) {
-:138: CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written "!prop" #138: FILE: drivers/gpu/drm/i915/intel_modes.c:147:
+ if (prop == NULL)
total: 0 errors, 0 warnings, 7 checks, 99 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for series starting with [v5,1/2] drm: Add connector property to limit max bpc
In reply to Radhakrishna Sripada== Series Details ==
== Series Details ==
Series: series starting with [v5,1/2] drm: Add connector property to limit max bpc
URL : https://patchwork.freedesktop.org/series/49230/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4775 -> Patchwork_10102 =
== Summary - SUCCESS ==
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/49230/revisions/1/mbox/
== Known issues ==
Here are the changes found in Patchwork_10102 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@debugfs_test@read_all_entries:
fi-snb-2520m: PASS -> INCOMPLETE (fdo#103713)
igt@drv_module_reload@basic-reload:
fi-blb-e6850: PASS -> INCOMPLETE (fdo#107718)
==== Possible fixes ====
igt@drv_selftest@live_coherency:
fi-gdg-551: DMESG-FAIL (fdo#107164) -> PASS
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
fi-byt-clapper: FAIL (fdo#107362, fdo#103191) -> PASS
igt@kms_psr@primary_page_flip:
fi-cnl-psr: FAIL (fdo#107336) -> PASS fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#107164 https://bugs.freedesktop.org/show_bug.cgi?id=107164
fdo#107336 https://bugs.freedesktop.org/show_bug.cgi?id=107336
fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
fdo#107718 https://bugs.freedesktop.org/show_bug.cgi?id=107718
== Participating hosts (54 -> 49) ==
Missing (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-hsw-4200u
== Build changes ==
* Linux: CI_DRM_4775 -> Patchwork_10102
CI_DRM_4775: 1a2bb6c061217718b972b3f4a74b96b61cf19d0c @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4630: 86686c6e2f7c6f0944bced11550e06d20bc6957f @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10102: 44f00038f50883e84572b1f94e54ea272d478557 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
44f00038f508 drm/i915: Allow "max bpc" property to limit pipe_bpp 2c48291891eb drm: Add connector property to limit max bpc
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10102/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v5 2/2] drm/i915: Allow "max bpc" property to limit pipe_bpp
In reply to Radhakrishna SripadaQuoted 60 lines · Radhakrishna Sripada
Use the newly added "max bpc" connector property to limit pipe bpp.
V3: Use
drm_connector_stateto access the "max bpc" property
V4: Initialize the drm property, add suuport to DP(Ville)
V5: Use the property in the connector and fix CI failure(Ville)Cc Ville Syrjälä <[email protected]>Cc Rodrigo Vivi <[email protected]>Cc Kishore Kadiyala <[email protected]>Cc Manasi Navare <[email protected]>Cc Stanislav Lisovskiy <[email protected]>Signed-off-by Radhakrishna Sripada <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 31 +++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_dp.c | 1 + drivers/gpu/drm/i915/intel_drv.h | 2 ++ drivers/gpu/drm/i915/intel_hdmi.c | 7 +++++++ drivers/gpu/drm/i915/intel_modes.c | 20 ++++++++++++++++++++ 5 files changed, 61 insertions(+)drivers/gpu/drm/i915/intel_display.c +28
-0@@ -10787,6 +10787,34 @@ connected_sink_compute_bpp(struct intel_connector *connector, } } +static void +connected_sink_max_bpp (struct drm_connector_state *conn_state, +struct intel_crtc_state *pipe_config) +{ +switch (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 : +case 13 : +case 14 : +case 15 : + pipe_config->pipe_bpp =12 *3 ; +break ; +case 16 : + pipe_config->pipe_bpp =16 *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)
drivers/gpu/drm/i915/intel_display.c compute_baseline_pipe_bpp(struct intel_crtc *crtc, · line 10847
Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +2
-0@@ -10815,6 +10843,9 @@ compute_baseline_pipe_bpp(struct intel_crtc *crtc,if (connector_state->crtc != &crtc->base)continue ; +if (connector_state->max_bpc) +connected_sink_max_bpp (connector_state, pipe_config);
I think this could wold be best put into shared code, computing a max_bpc that takes connector->display_info and connector_state->max_bpc into account. So part of the core drm patch. Would need both a ->max_bpc and a ->max_requested_bpc for the property value or something like that.
Besides this small nit I think this looks solid from a high level. -Daniel
Quoted 87 lines
drivers/gpu/drm/i915/intel_display.c +1
-0+connected_sink_compute_bpp (to_intel_connector (connector), pipe_config); }drivers/gpu/drm/i915/intel_dp.c +1
-0@@ -5719,6 +5719,7 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connectintel_attach_force_audio_property (connector);intel_attach_broadcast_rgb_property (connector); +intel_attach_max_bpc_property (connector,8 ,16 );if (intel_dp_is_edp (intel_dp)) {u32 allowed_scalers;drivers/gpu/drm/i915/intel_drv.h +2
-0@@ -1869,6 +1869,8 @@ 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 +7
-0@@ -2109,11 +2109,18 @@ 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);drm_connector_attach_content_type_property (connector); connector->state->picture_aspect_ratio =HDMI_PICTURE_ASPECT_NONE ; + +if (HAS_GMCH_DISPLAY (dev_priv)) +intel_attach_max_bpc_property (connector,8 ,8 ); +else +intel_attach_max_bpc_property (connector,8 ,12 ); }/* drivers/gpu/drm/i915/intel_modes.c +20
-0@@ -133,3 +133,23 @@ 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_property *prop; + + prop = connector->max_bpc_property; +if (prop ==NULL ) { + prop =drm_property_create_range (dev,0 ,"max bpc" , min, max); +if (prop ==NULL ) +return ; + + connector->max_bpc_property = prop; + } + +drm_object_attach_property (&connector->base, prop, max); + connector->state->max_bpc = max; +}Signature · 6 lines
2.9.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Patchwork
CI✓ Fi.CI.IGT: success for series starting with [v5,1/2] drm: Add connector property to limit max bpc
In reply to Radhakrishna Sripada== Series Details ==
== Series Details ==
Series: series starting with [v5,1/2] drm: Add connector property to limit max bpc
URL : https://patchwork.freedesktop.org/series/49230/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4775_full -> Patchwork_10102_full =
== Summary - SUCCESS ==
No regressions found.
== Known issues ==
Here are the changes found in Patchwork_10102_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@drv_suspend@shrink:
shard-glk: PASS -> FAIL (fdo#106886)
igt@kms_draw_crc@draw-method-rgb565-mmap-wc-xtiled:
shard-glk: PASS -> FAIL (fdo#103184)
igt@kms_flip@flip-vs-expired-vblank:
shard-glk: PASS -> FAIL (fdo#105363)
igt@kms_flip@flip-vs-expired-vblank-interruptible:
shard-glk: PASS -> FAIL (fdo#102887, fdo#105363)
==== Possible fixes ====
igt@gem_exec_big:
shard-hsw: INCOMPLETE (fdo#103540) -> PASS
igt@kms_flip@modeset-vs-vblank-race-interruptible:
shard-glk: INCOMPLETE (k.org#198133, fdo#103359) -> PASS fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#103184 https://bugs.freedesktop.org/show_bug.cgi?id=103184
fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
fdo#103540 https://bugs.freedesktop.org/show_bug.cgi?id=103540
fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
fdo#106886 https://bugs.freedesktop.org/show_bug.cgi?id=106886
k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133
== Participating hosts (5 -> 5) ==
No changes in participating hosts
== Build changes ==
* Linux: CI_DRM_4775 -> Patchwork_10102
CI_DRM_4775: 1a2bb6c061217718b972b3f4a74b96b61cf19d0c @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4630: 86686c6e2f7c6f0944bced11550e06d20bc6957f @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10102: 44f00038f50883e84572b1f94e54ea272d478557 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10102/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v5 2/2] drm/i915: Allow "max bpc" property to limit pipe_bpp
In reply to Radhakrishna SripadaQuoted 74 lines · Radhakrishna Sripada
Use the newly added "max bpc" connector property to limit pipe bpp.
V3: Use
drm_connector_stateto access the "max bpc" property
V4: Initialize the drm property, add suuport to DP(Ville)
V5: Use the property in the connector and fix CI failure(Ville)Cc Ville Syrjälä <[email protected]>Cc Rodrigo Vivi <[email protected]>Cc Kishore Kadiyala <[email protected]>Cc Manasi Navare <[email protected]>Cc Stanislav Lisovskiy <[email protected]>Signed-off-by Radhakrishna Sripada <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 31 +++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_dp.c | 1 + drivers/gpu/drm/i915/intel_drv.h | 2 ++ drivers/gpu/drm/i915/intel_hdmi.c | 7 +++++++ drivers/gpu/drm/i915/intel_modes.c | 20 ++++++++++++++++++++ 5 files changed, 61 insertions(+)drivers/gpu/drm/i915/intel_display.c +31
-0@@ -10787,6 +10787,34 @@ connected_sink_compute_bpp(struct intel_connector *connector, } } +static void +connected_sink_max_bpp (struct drm_connector_state *conn_state, +struct intel_crtc_state *pipe_config) +{ +switch (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 : +case 13 : +case 14 : +case 15 : + pipe_config->pipe_bpp =12 *3 ; +break ; +case 16 : + pipe_config->pipe_bpp =16 *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)@@ -10815,6 +10843,9 @@ compute_baseline_pipe_bpp(struct intel_crtc *crtc,if (connector_state->crtc != &crtc->base)continue ; +if (connector_state->max_bpc) +connected_sink_max_bpp (connector_state, pipe_config); +connected_sink_compute_bpp (to_intel_connector (connector), pipe_config); }drivers/gpu/drm/i915/intel_dp.c +0
-0
drivers/gpu/drm/i915/intel_dp.c intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect · line 5722
Quoted 4 lines
drivers/gpu/drm/i915/intel_dp.c +1
-0@@ -5719,6 +5719,7 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connectintel_attach_force_audio_property (connector);intel_attach_broadcast_rgb_property (connector); +intel_attach_max_bpc_property (connector,8 ,16 );
IIRC gmch platforms can't do more than 10bpc, and the rest are limited to 12bpc.
Quoted 24 lines
drivers/gpu/drm/i915/intel_dp.c +0
-0if (intel_dp_is_edp (intel_dp)) {u32 allowed_scalers;drivers/gpu/drm/i915/intel_drv.h +2
-0@@ -1869,6 +1869,8 @@ 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 +0
-0@@ -2109,11 +2109,18 @@ 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) {
drivers/gpu/drm/i915/intel_hdmi.c static const struct drm_encoder_funcs intel_hdmi_enc_funcs = { · line 2121
Quoted 10 lines
drivers/gpu/drm/i915/intel_hdmi.c +5
-0+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);drm_connector_attach_content_type_property (connector); connector->state->picture_aspect_ratio =HDMI_PICTURE_ASPECT_NONE ; + +if (HAS_GMCH_DISPLAY (dev_priv)) +intel_attach_max_bpc_property (connector,8 ,8 );
Not sure exposing the prop makes much sense when you can't modify it.
Quoted 23 lines
drivers/gpu/drm/i915/intel_hdmi.c +2
-0+else +intel_attach_max_bpc_property (connector,8 ,12 ); }/* drivers/gpu/drm/i915/intel_modes.c +10
-0@@ -133,3 +133,23 @@ 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_property *prop; + + prop = connector->max_bpc_property; +if (prop ==NULL ) {
drivers/gpu/drm/i915/intel_modes.c intel_attach_aspect_ratio_property(struct drm_connector *connector) · line 155
Quoted 10 lines
drivers/gpu/drm/i915/intel_modes.c +10
-0+ prop =drm_property_create_range (dev,0 ,"max bpc" , min, max); +if (prop ==NULL ) +return ; + + connector->max_bpc_property = prop; + } + +drm_object_attach_property (&connector->base, prop, max); + connector->state->max_bpc = max; +}
There's nothing i915 specific in this function, so might as well move it to the core.
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel