]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm: Drop drm_helper_probe_single_connector_modes_nomerge()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 3 Dec 2015 21:14:14 +0000 (23:14 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 11 Dec 2015 08:32:53 +0000 (09:32 +0100)
Now that the mode type bit merge logic is fixed to only merge
between new probed modes, hopefully we can eliminat the special
case for qxl and virtio. That is make the merge the mode type
bits from all matching new probed modes, just like every other
driver.

qxl and virtio got excluded from the merging in
commit 3fbd6439e463 ("drm: copy mode type in drm_mode_connector_list_update()")
commit abce1ec9b08a ("Revert "drm: copy mode type in drm_mode_connector_list_update()"")
commit b87577b7c768 ("drm: try harder to avoid regression when merging mode bits")

Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Adam Jackson <ajax@redhat.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
[danvet: Resolve conflicts with doc updates.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_modes.c
drivers/gpu/drm/drm_probe_helper.c
drivers/gpu/drm/qxl/qxl_display.c
drivers/gpu/drm/virtio/virtgpu_display.c
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
include/drm/drm_crtc_helper.h
include/drm/drm_modes.h

index 1888e3cbdeaffc2b0ca0309bb13446a7a8fe0e3f..a15e26281a41f200cfd730b11c262e3b2b4b445f 100644 (file)
@@ -1172,7 +1172,6 @@ EXPORT_SYMBOL(drm_mode_sort);
 /**
  * drm_mode_connector_list_update - update the mode list for the connector
  * @connector: the connector to update
- * @merge_type_bits: whether to merge or overwrite type bits
  *
  * This moves the modes from the @connector probed_modes list
  * to the actual mode list. It compares the probed mode against the current
@@ -1181,8 +1180,7 @@ EXPORT_SYMBOL(drm_mode_sort);
  * This is just a helper functions doesn't validate any modes itself and also
  * doesn't prune any invalid modes. Callers need to do that themselves.
  */
-void drm_mode_connector_list_update(struct drm_connector *connector,
-                                   bool merge_type_bits)
+void drm_mode_connector_list_update(struct drm_connector *connector)
 {
        struct drm_display_mode *pmode, *pt;
 
@@ -1215,14 +1213,10 @@ void drm_mode_connector_list_update(struct drm_connector *connector,
                                drm_mode_copy(mode, pmode);
                        } else if ((mode->type & DRM_MODE_TYPE_PREFERRED) == 0 &&
                                   (pmode->type & DRM_MODE_TYPE_PREFERRED) != 0) {
-                               if (merge_type_bits)
-                                       pmode->type |= mode->type;
+                               pmode->type |= mode->type;
                                drm_mode_copy(mode, pmode);
                        } else {
-                               if (merge_type_bits)
-                                       mode->type |= pmode->type;
-                               else
-                                       mode->type = pmode->type;
+                               mode->type |= pmode->type;
                        }
 
                        list_del(&pmode->head);
index 3bdc8684fe58c633b0c59f3c57c9e0a40d857c36..483010f680d55950c6519f780d51b6c744025c6c 100644 (file)
@@ -129,9 +129,39 @@ void drm_kms_helper_poll_enable_locked(struct drm_device *dev)
 }
 EXPORT_SYMBOL(drm_kms_helper_poll_enable_locked);
 
-
-static int drm_helper_probe_single_connector_modes_merge_bits(struct drm_connector *connector,
-                                                             uint32_t maxX, uint32_t maxY, bool merge_type_bits)
+/**
+ * drm_helper_probe_single_connector_modes - get complete set of display modes
+ * @connector: connector to probe
+ * @maxX: max width for modes
+ * @maxY: max height for modes
+ *
+ * Based on the helper callbacks implemented by @connector in struct
+ * &drm_connector_helper_funcs try to detect all valid modes.  Modes will first
+ * be added to the connector's probed_modes list, then culled (based on validity
+ * and the @maxX, @maxY parameters) and put into the normal modes list.
+ *
+ * Intended to be used as a generic implementation of the ->fill_modes()
+ * @connector vfunc for drivers that use the CRTC helpers for output mode
+ * filtering and detection.
+ *
+ * If the helper operation returns no mode, and if the connector status is
+ * connector_status_connected, standard VESA DMT modes up to 1024x768 are
+ * automatically added to the modes list by a call to
+ * drm_add_modes_noedid().
+ *
+ * The function then filters out modes larger than @maxX and maxY if specified.
+ * It finally calls the optional connector ->mode_valid() helper operation for each
+ * mode in the probed list to check whether the mode is valid for the connector.
+ *
+ * Compared to drm_helper_probe_single_connector_modes_nomerge() this function
+ * merged the mode bits for the preferred mode, as a hack to work around some
+ * quirky issues on funky hardware.
+ *
+ * Returns:
+ * The number of modes found on @connector.
+ */
+int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
+                                           uint32_t maxX, uint32_t maxY)
 {
        struct drm_device *dev = connector->dev;
        struct drm_display_mode *mode;
@@ -223,7 +253,7 @@ static int drm_helper_probe_single_connector_modes_merge_bits(struct drm_connect
        if (count == 0)
                goto prune;
 
-       drm_mode_connector_list_update(connector, merge_type_bits);
+       drm_mode_connector_list_update(connector);
 
        if (connector->interlace_allowed)
                mode_flags |= DRM_MODE_FLAG_INTERLACE;
@@ -267,64 +297,8 @@ static int drm_helper_probe_single_connector_modes_merge_bits(struct drm_connect
 
        return count;
 }
-
-/**
- * drm_helper_probe_single_connector_modes - get complete set of display modes
- * @connector: connector to probe
- * @maxX: max width for modes
- * @maxY: max height for modes
- *
- * Based on the helper callbacks implemented by @connector in struct
- * &drm_connector_helper_funcs try to detect all valid modes.  Modes will first
- * be added to the connector's probed_modes list, then culled (based on validity
- * and the @maxX, @maxY parameters) and put into the normal modes list.
- *
- * Intended to be used as a generic implementation of the ->fill_modes()
- * @connector vfunc for drivers that use the CRTC helpers for output mode
- * filtering and detection.
- *
- * If the helper operation returns no mode, and if the connector status is
- * connector_status_connected, standard VESA DMT modes up to 1024x768 are
- * automatically added to the modes list by a call to
- * drm_add_modes_noedid().
- *
- * The function then filters out modes larger than @maxX and maxY if specified.
- * It finally calls the optional connector ->mode_valid() helper operation for each
- * mode in the probed list to check whether the mode is valid for the connector.
- *
- * Compared to drm_helper_probe_single_connector_modes_nomerge() this function
- * merged the mode bits for the preferred mode, as a hack to work around some
- * quirky issues on funky hardware.
- *
- * Returns:
- * The number of modes found on @connector.
- */
-int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
-                                           uint32_t maxX, uint32_t maxY)
-{
-       return drm_helper_probe_single_connector_modes_merge_bits(connector, maxX, maxY, true);
-}
 EXPORT_SYMBOL(drm_helper_probe_single_connector_modes);
 
-/**
- * drm_helper_probe_single_connector_modes_nomerge - get complete set of display modes
- * @connector: connector to probe
- * @maxX: max width for modes
- * @maxY: max height for modes
- *
- * This operates like drm_hehlper_probe_single_connector_modes() except it
- * replaces the mode bits instead of merging them for preferred modes.
- *
- * Returns:
- * The number of modes found on @connector.
- */
-int drm_helper_probe_single_connector_modes_nomerge(struct drm_connector *connector,
-                                           uint32_t maxX, uint32_t maxY)
-{
-       return drm_helper_probe_single_connector_modes_merge_bits(connector, maxX, maxY, false);
-}
-EXPORT_SYMBOL(drm_helper_probe_single_connector_modes_nomerge);
-
 /**
  * drm_kms_helper_hotplug_event - fire off KMS hotplug events
  * @dev: drm_device whose connector state changed
index 9be1af41e8d7f8c364734afe5e2aa095edb04473..86276519b2efe900182754d0e5f6fc79cef611f2 100644 (file)
@@ -923,7 +923,7 @@ static void qxl_conn_destroy(struct drm_connector *connector)
 static const struct drm_connector_funcs qxl_connector_funcs = {
        .dpms = drm_helper_connector_dpms,
        .detect = qxl_conn_detect,
-       .fill_modes = drm_helper_probe_single_connector_modes_nomerge,
+       .fill_modes = drm_helper_probe_single_connector_modes,
        .set_property = qxl_conn_set_property,
        .destroy = qxl_conn_destroy,
 };
index 588a7aec60bf5db4128cb6e8c608fdecf986299a..a165f03eaa79f452f27c329eb5bd18fc12ebd46a 100644 (file)
@@ -400,7 +400,7 @@ static void virtio_gpu_conn_destroy(struct drm_connector *connector)
 static const struct drm_connector_funcs virtio_gpu_connector_funcs = {
        .dpms = drm_atomic_helper_connector_dpms,
        .detect = virtio_gpu_conn_detect,
-       .fill_modes = drm_helper_probe_single_connector_modes_nomerge,
+       .fill_modes = drm_helper_probe_single_connector_modes,
        .destroy = virtio_gpu_conn_destroy,
        .reset = drm_atomic_helper_connector_reset,
        .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
index d50596153679167d9bd89c3b9e38a9f533e9befc..9394c3535e8553b65fcc432ee32fe73a3e3d95f8 100644 (file)
@@ -1538,7 +1538,7 @@ int vmw_du_connector_fill_modes(struct drm_connector *connector,
                drm_mode_probed_add(connector, mode);
        }
 
-       drm_mode_connector_list_update(connector, true);
+       drm_mode_connector_list_update(connector);
        /* Move the prefered mode first, help apps pick the right mode. */
        drm_mode_sort(&connector->modes);
 
index f94ff54ae25e583d79b01be19d05b765d57f01f5..4b37afa2b73b4a106d7beef61f7b5be0198fe983 100644 (file)
@@ -70,10 +70,6 @@ int drm_helper_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
 extern int drm_helper_probe_single_connector_modes(struct drm_connector
                                                   *connector, uint32_t maxX,
                                                   uint32_t maxY);
-extern int drm_helper_probe_single_connector_modes_nomerge(struct drm_connector
-                                                          *connector,
-                                                          uint32_t maxX,
-                                                          uint32_t maxY);
 extern void drm_kms_helper_poll_init(struct drm_device *dev);
 extern void drm_kms_helper_poll_fini(struct drm_device *dev);
 extern bool drm_helper_hpd_irq_event(struct drm_device *dev);
index d7445ccd958d606b87d80b77717c1ab199db59ca..625966a906f2b0cf50eaa754bcb62e5e8e237354 100644 (file)
@@ -483,7 +483,7 @@ enum drm_mode_status drm_mode_validate_size(const struct drm_display_mode *mode,
 void drm_mode_prune_invalid(struct drm_device *dev,
                            struct list_head *mode_list, bool verbose);
 void drm_mode_sort(struct list_head *mode_list);
-void drm_mode_connector_list_update(struct drm_connector *connector, bool merge_type_bits);
+void drm_mode_connector_list_update(struct drm_connector *connector);
 
 /* parsing cmdline modes */
 bool