diff options
author | Dave Airlie <airlied@redhat.com> | 2017-05-17 22:57:06 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2017-05-17 22:57:06 -0400 |
commit | e98c58e55f68f8785aebfab1f8c9a03d8de0afe1 (patch) | |
tree | 8357e8fda6efb0867ac39fc6b9211a579721d00a /drivers/gpu/drm/drm_connector.c | |
parent | 2ea659a9ef488125eb46da6eb571de5eae5c43f6 (diff) | |
parent | 9cf8f5802f39d9991158b29033c852bccfc3a4d4 (diff) |
Merge tag 'drm-misc-next-2017-05-16' of git://anongit.freedesktop.org/git/drm-misc into drm-next
UAPI Changes:
- Return -ENODEV instead of -ENXIO when creating cma fb w/o valid gem (Daniel)
- Add aspect ratio and custom scaling propertis to connector state (Maarten)
Cross-subsystem Changes:
- None
Core Changes:
- Add Laurent as bridge reviewer and Andrzej as bridge maintainer (Archit)
- Maintain new STM driver through -misc (Yannick)
- Misc doc improvements (as is tradition) (Daniel)
- Add driver-private objects to atomic state (Dhinakaran)
- Deprecate preclose hook in modern drivers (use postclose) (Daniel)
- Add hwmode to vblank struct. This fixes mode access in irq context and reduced
a bunch of boilerplate (Daniel)
Driver Changes:
- vc4: Add out-fence support to vc4 V3D rendering (Eric)
- stm: Add stm32f429 display hw and am-480272h3tmqw-t01h panel support (Yannick)
- vc4: Remove 256MB cma limit from vc4 (Eric)
- dw-hdmi: Disable audio when inactive, instead of always enabled (Romain)
- zte: Add support for VGA to the ZTE driver (Shawn)
- i915: Track DP MST bandwidth and check it in atomic_check (Dhinakaran)
- vgem: Enable gem dmabuf import iface to facilitate ion testing (Laura)
- vc4: Add support for Cygnus (new dt compat string + couple bug fixes) (Eric)
- pl111: Add driver for pl111 CLCD display controller (Eric/Tom)
- vgem: Subclass drm_device instead of standalone platform device (Chris)
Cc: Archit Taneja <architt@codeaurora.org>
Cc: Eric Anholt <eric@anholt.net>
Cc: Yannick Fertre <yannick.fertre@st.com>
Cc: Romain Perier <romain.perier@collabora.com>
Cc: Navare, Manasi D <manasi.d.navare@intel.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Tom Cooksey <tom.cooksey@arm.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
* tag 'drm-misc-next-2017-05-16' of git://anongit.freedesktop.org/git/drm-misc: (72 commits)
drm: add missing declaration to drm_blend.h
drm/dp: Wait up all outstanding tx waiters
drm/dp: Read the tx msg state once after checking for an event
drm/prime: Forward declare struct device
drm/vblank: Lock down vblank->hwmode more
drm/vblank: drop the mode argument from drm_calc_vbltimestamp_from_scanoutpos
drm/vblank: Add FIXME comments about moving the vblank ts hooks
drm/vblank: Switch to bool in_vblank_irq in get_vblank_timestamp
drm/vblank: Switch drm_driver->get_vblank_timestamp to return a bool
drm/vgem: Convert to a struct drm_device subclass
gpu: drm: gma500: remove dead code
drm/sti: Adjust two checks for null pointers in sti_hqvdp_probe()
drm/sti: Fix typos in a comment line
drm/sti: Fix a typo in a comment line
drm/sti: Replace 17 seq_puts() calls by seq_putc()
drm/sti: Reduce function calls for sequence output at five places
drm/sti: use seq_puts to display a string
drm: Nerf the preclose callback for modern drivers
drm/exynos: Merge pre/postclose hooks
drm/tegra: switch to postclose
...
Diffstat (limited to 'drivers/gpu/drm/drm_connector.c')
-rw-r--r-- | drivers/gpu/drm/drm_connector.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 9f847615ac74..5cd61aff7857 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c | |||
@@ -941,6 +941,10 @@ EXPORT_SYMBOL(drm_mode_create_tv_properties); | |||
941 | * | 941 | * |
942 | * Called by a driver the first time it's needed, must be attached to desired | 942 | * Called by a driver the first time it's needed, must be attached to desired |
943 | * connectors. | 943 | * connectors. |
944 | * | ||
945 | * Atomic drivers should use drm_connector_attach_scaling_mode_property() | ||
946 | * instead to correctly assign &drm_connector_state.picture_aspect_ratio | ||
947 | * in the atomic state. | ||
944 | */ | 948 | */ |
945 | int drm_mode_create_scaling_mode_property(struct drm_device *dev) | 949 | int drm_mode_create_scaling_mode_property(struct drm_device *dev) |
946 | { | 950 | { |
@@ -961,6 +965,66 @@ int drm_mode_create_scaling_mode_property(struct drm_device *dev) | |||
961 | EXPORT_SYMBOL(drm_mode_create_scaling_mode_property); | 965 | EXPORT_SYMBOL(drm_mode_create_scaling_mode_property); |
962 | 966 | ||
963 | /** | 967 | /** |
968 | * drm_connector_attach_scaling_mode_property - attach atomic scaling mode property | ||
969 | * @connector: connector to attach scaling mode property on. | ||
970 | * @scaling_mode_mask: or'ed mask of BIT(%DRM_MODE_SCALE_\*). | ||
971 | * | ||
972 | * This is used to add support for scaling mode to atomic drivers. | ||
973 | * The scaling mode will be set to &drm_connector_state.picture_aspect_ratio | ||
974 | * and can be used from &drm_connector_helper_funcs->atomic_check for validation. | ||
975 | * | ||
976 | * This is the atomic version of drm_mode_create_scaling_mode_property(). | ||
977 | * | ||
978 | * Returns: | ||
979 | * Zero on success, negative errno on failure. | ||
980 | */ | ||
981 | int drm_connector_attach_scaling_mode_property(struct drm_connector *connector, | ||
982 | u32 scaling_mode_mask) | ||
983 | { | ||
984 | struct drm_device *dev = connector->dev; | ||
985 | struct drm_property *scaling_mode_property; | ||
986 | int i, j = 0; | ||
987 | const unsigned valid_scaling_mode_mask = | ||
988 | (1U << ARRAY_SIZE(drm_scaling_mode_enum_list)) - 1; | ||
989 | |||
990 | if (WARN_ON(hweight32(scaling_mode_mask) < 2 || | ||
991 | scaling_mode_mask & ~valid_scaling_mode_mask)) | ||
992 | return -EINVAL; | ||
993 | |||
994 | scaling_mode_property = | ||
995 | drm_property_create(dev, DRM_MODE_PROP_ENUM, "scaling mode", | ||
996 | hweight32(scaling_mode_mask)); | ||
997 | |||
998 | if (!scaling_mode_property) | ||
999 | return -ENOMEM; | ||
1000 | |||
1001 | for (i = 0; i < ARRAY_SIZE(drm_scaling_mode_enum_list); i++) { | ||
1002 | int ret; | ||
1003 | |||
1004 | if (!(BIT(i) & scaling_mode_mask)) | ||
1005 | continue; | ||
1006 | |||
1007 | ret = drm_property_add_enum(scaling_mode_property, j++, | ||
1008 | drm_scaling_mode_enum_list[i].type, | ||
1009 | drm_scaling_mode_enum_list[i].name); | ||
1010 | |||
1011 | if (ret) { | ||
1012 | drm_property_destroy(dev, scaling_mode_property); | ||
1013 | |||
1014 | return ret; | ||
1015 | } | ||
1016 | } | ||
1017 | |||
1018 | drm_object_attach_property(&connector->base, | ||
1019 | scaling_mode_property, 0); | ||
1020 | |||
1021 | connector->scaling_mode_property = scaling_mode_property; | ||
1022 | |||
1023 | return 0; | ||
1024 | } | ||
1025 | EXPORT_SYMBOL(drm_connector_attach_scaling_mode_property); | ||
1026 | |||
1027 | /** | ||
964 | * drm_mode_create_aspect_ratio_property - create aspect ratio property | 1028 | * drm_mode_create_aspect_ratio_property - create aspect ratio property |
965 | * @dev: DRM device | 1029 | * @dev: DRM device |
966 | * | 1030 | * |