From: Dave Airlie Date: Thu, 6 Dec 2018 03:28:19 +0000 (+1000) Subject: Merge branch 'drm-next-4.21' of git://people.freedesktop.org/~agd5f/linux into drm... X-Git-Tag: v5.4.17~4589^2~8 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=513126ae00ba897cac1ab07f61edf062093d4dcb;p=arm%2Flinux.git Merge branch 'drm-next-4.21' of git://people.freedesktop.org/~agd5f/linux into drm-next amdgpu and amdkfd: - Freesync support - ABM support in DC - KFD support for vega12 and polaris12 - Add sdma paging queue support for vega - Use ACPI to query backlight range on supported platforms - Clean up doorbell handling - KFD fix for pasid handling under non-HWS - Misc cleanups and fixes scheduler: - Revert "fix timeout handling v2" radeon: - Fix possible overflow on 32 bit ttm: - Fix for LRU handling for ghost objects Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20181130192505.2946-1-alexander.deucher@amd.com --- 513126ae00ba897cac1ab07f61edf062093d4dcb diff --cc drivers/gpu/drm/drm_connector.c index fa9baacc863b,ead26bfc30ca..da8ae80c2750 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@@ -1606,40 -1698,24 +1705,58 @@@ void drm_connector_set_link_status_prop } EXPORT_SYMBOL(drm_connector_set_link_status_property); +/** + * drm_connector_attach_max_bpc_property - attach "max bpc" property + * @connector: connector to attach max bpc property on. + * @min: The minimum bit depth supported by the connector. + * @max: The maximum bit depth supported by the connector. + * + * This is used to add support for limiting the bit depth on a connector. + * + * Returns: + * Zero on success, negative errno on failure. + */ +int drm_connector_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) { + prop = drm_property_create_range(dev, 0, "max bpc", min, max); + if (!prop) + return -ENOMEM; + + connector->max_bpc_property = prop; + } + + drm_object_attach_property(&connector->base, prop, max); + connector->state->max_requested_bpc = max; + connector->state->max_bpc = max; + + return 0; +} +EXPORT_SYMBOL(drm_connector_attach_max_bpc_property); + + /** + * drm_connector_set_vrr_capable_property - sets the variable refresh rate + * capable property for a connector + * @connector: drm connector + * @capable: True if the connector is variable refresh rate capable + * + * Should be used by atomic drivers to update the indicated support for + * variable refresh rate over a connector. + */ + void drm_connector_set_vrr_capable_property( + struct drm_connector *connector, bool capable) + { + drm_object_property_set_value(&connector->base, + connector->vrr_capable_property, + capable); + } + EXPORT_SYMBOL(drm_connector_set_vrr_capable_property); + /** * drm_connector_init_panel_orientation_property - * initialize the connecters panel_orientation property diff --cc include/drm/drm_connector.h index 665b9cae7f43,3ddd706735f7..9be2181b3ed7 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@@ -1261,10 -1280,10 +1274,12 @@@ int drm_connector_update_edid_property( const struct edid *edid); void drm_connector_set_link_status_property(struct drm_connector *connector, uint64_t link_status); + void drm_connector_set_vrr_capable_property( + struct drm_connector *connector, bool capable); int drm_connector_init_panel_orientation_property( struct drm_connector *connector, int width, int height); +int drm_connector_attach_max_bpc_property(struct drm_connector *connector, + int min, int max); /** * struct drm_tile_group - Tile group metadata