diff options
author | Álvaro Fernández Rojas <noltari@gmail.com> | 2019-08-09 19:50:30 +0200 |
---|---|---|
committer | Álvaro Fernández Rojas <noltari@gmail.com> | 2019-08-27 11:10:01 +0200 |
commit | 2340c646e6a5da658e114be2f721ff90853588d4 (patch) | |
tree | df9744d2344e71e8c5d1b75c3e1528bc474313fe /target/linux/brcm2708/patches-4.19/950-0716-drm-connector-Allow-creation-of-margin-props-alone.patch | |
parent | 81d0da118694feb874f992093063a2852285d194 (diff) | |
download | upstream-2340c646e6a5da658e114be2f721ff90853588d4.tar.gz upstream-2340c646e6a5da658e114be2f721ff90853588d4.tar.bz2 upstream-2340c646e6a5da658e114be2f721ff90853588d4.zip |
brcm2708: update to latest patches from RPi foundation
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/brcm2708/patches-4.19/950-0716-drm-connector-Allow-creation-of-margin-props-alone.patch')
-rw-r--r-- | target/linux/brcm2708/patches-4.19/950-0716-drm-connector-Allow-creation-of-margin-props-alone.patch | 136 |
1 files changed, 136 insertions, 0 deletions
diff --git a/target/linux/brcm2708/patches-4.19/950-0716-drm-connector-Allow-creation-of-margin-props-alone.patch b/target/linux/brcm2708/patches-4.19/950-0716-drm-connector-Allow-creation-of-margin-props-alone.patch new file mode 100644 index 0000000000..87c29aa87b --- /dev/null +++ b/target/linux/brcm2708/patches-4.19/950-0716-drm-connector-Allow-creation-of-margin-props-alone.patch @@ -0,0 +1,136 @@ +From a39d399ecb26cad762a057cabceb965ffda71d81 Mon Sep 17 00:00:00 2001 +From: Boris Brezillon <boris.brezillon@bootlin.com> +Date: Thu, 6 Dec 2018 15:24:37 +0100 +Subject: [PATCH 716/773] drm/connector: Allow creation of margin props alone + +Commit 6c4f52dca36f5e3e2354c30591d38e92f4657ed9 upstream. + +TV margins properties can only be added as part of the SDTV TV +connector properties creation, but we might need those props for HDMI +TVs too, so let's move the margins props creation in a separate +function and expose it to drivers. + +We also add an helper to attach margins props to a connector. + +Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> +Reviewed-by: Eric Anholt <eric@anholt.net> +Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> +Link: https://patchwork.freedesktop.org/patch/msgid/20181206142439.10441-4-boris.brezillon@bootlin.com +--- + drivers/gpu/drm/drm_connector.c | 83 ++++++++++++++++++++++++++------- + include/drm/drm_connector.h | 2 + + 2 files changed, 67 insertions(+), 18 deletions(-) + +--- a/drivers/gpu/drm/drm_connector.c ++++ b/drivers/gpu/drm/drm_connector.c +@@ -1110,6 +1110,70 @@ void drm_hdmi_avi_infoframe_content_type + EXPORT_SYMBOL(drm_hdmi_avi_infoframe_content_type); + + /** ++ * drm_mode_attach_tv_margin_properties - attach TV connector margin properties ++ * @connector: DRM connector ++ * ++ * Called by a driver when it needs to attach TV margin props to a connector. ++ * Typically used on SDTV and HDMI connectors. ++ */ ++void drm_connector_attach_tv_margin_properties(struct drm_connector *connector) ++{ ++ struct drm_device *dev = connector->dev; ++ ++ drm_object_attach_property(&connector->base, ++ dev->mode_config.tv_left_margin_property, ++ 0); ++ drm_object_attach_property(&connector->base, ++ dev->mode_config.tv_right_margin_property, ++ 0); ++ drm_object_attach_property(&connector->base, ++ dev->mode_config.tv_top_margin_property, ++ 0); ++ drm_object_attach_property(&connector->base, ++ dev->mode_config.tv_bottom_margin_property, ++ 0); ++} ++EXPORT_SYMBOL(drm_connector_attach_tv_margin_properties); ++ ++/** ++ * drm_mode_create_tv_margin_properties - create TV connector margin properties ++ * @dev: DRM device ++ * ++ * Called by a driver's HDMI connector initialization routine, this function ++ * creates the TV margin properties for a given device. No need to call this ++ * function for an SDTV connector, it's already called from ++ * drm_mode_create_tv_properties(). ++ */ ++int drm_mode_create_tv_margin_properties(struct drm_device *dev) ++{ ++ if (dev->mode_config.tv_left_margin_property) ++ return 0; ++ ++ dev->mode_config.tv_left_margin_property = ++ drm_property_create_range(dev, 0, "left margin", 0, 100); ++ if (!dev->mode_config.tv_left_margin_property) ++ return -ENOMEM; ++ ++ dev->mode_config.tv_right_margin_property = ++ drm_property_create_range(dev, 0, "right margin", 0, 100); ++ if (!dev->mode_config.tv_right_margin_property) ++ return -ENOMEM; ++ ++ dev->mode_config.tv_top_margin_property = ++ drm_property_create_range(dev, 0, "top margin", 0, 100); ++ if (!dev->mode_config.tv_top_margin_property) ++ return -ENOMEM; ++ ++ dev->mode_config.tv_bottom_margin_property = ++ drm_property_create_range(dev, 0, "bottom margin", 0, 100); ++ if (!dev->mode_config.tv_bottom_margin_property) ++ return -ENOMEM; ++ ++ return 0; ++} ++EXPORT_SYMBOL(drm_mode_create_tv_margin_properties); ++ ++/** + * drm_mode_create_tv_properties - create TV specific connector properties + * @dev: DRM device + * @num_modes: number of different TV formats (modes) supported +@@ -1155,24 +1219,7 @@ int drm_mode_create_tv_properties(struct + /* + * Other, TV specific properties: margins & TV modes. + */ +- dev->mode_config.tv_left_margin_property = +- drm_property_create_range(dev, 0, "left margin", 0, 100); +- if (!dev->mode_config.tv_left_margin_property) +- goto nomem; +- +- dev->mode_config.tv_right_margin_property = +- drm_property_create_range(dev, 0, "right margin", 0, 100); +- if (!dev->mode_config.tv_right_margin_property) +- goto nomem; +- +- dev->mode_config.tv_top_margin_property = +- drm_property_create_range(dev, 0, "top margin", 0, 100); +- if (!dev->mode_config.tv_top_margin_property) +- goto nomem; +- +- dev->mode_config.tv_bottom_margin_property = +- drm_property_create_range(dev, 0, "bottom margin", 0, 100); +- if (!dev->mode_config.tv_bottom_margin_property) ++ if (drm_mode_create_tv_margin_properties(dev)) + goto nomem; + + dev->mode_config.tv_mode_property = +--- a/include/drm/drm_connector.h ++++ b/include/drm/drm_connector.h +@@ -1175,9 +1175,11 @@ const char *drm_get_tv_select_name(int v + const char *drm_get_content_protection_name(int val); + + int drm_mode_create_dvi_i_properties(struct drm_device *dev); ++int drm_mode_create_tv_margin_properties(struct drm_device *dev); + int drm_mode_create_tv_properties(struct drm_device *dev, + unsigned int num_modes, + const char * const modes[]); ++void drm_connector_attach_tv_margin_properties(struct drm_connector *conn); + int drm_mode_create_scaling_mode_property(struct drm_device *dev); + int drm_connector_attach_content_type_property(struct drm_connector *dev); + int drm_connector_attach_scaling_mode_property(struct drm_connector *connector, |