Re: [PATCH 6/7] drm: Drop drm_helper_probe_single_connector_modes_nomerge()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 03, 2015 at 11:14:14PM +0200, ville.syrjala@xxxxxxxxxxxxxxx wrote:
> From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> 
> 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@xxxxxxxxxx>
> Cc: Dave Airlie <airlied@xxxxxxxxxx>
> Cc: Daniel Vetter <daniel.vetter@xxxxxxxx>
> Cc: Adam Jackson <ajax@xxxxxxxxxx>
> Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

Reviewed-by: Daniel Vetter <daniel.vetter@xxxxxxxx>

> ---
>  drivers/gpu/drm/drm_modes.c              | 12 ++----
>  drivers/gpu/drm/drm_probe_helper.c       | 65 +++++++++++---------------------
>  drivers/gpu/drm/qxl/qxl_display.c        |  2 +-
>  drivers/gpu/drm/virtio/virtgpu_display.c |  2 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_kms.c      |  2 +-
>  include/drm/drm_crtc_helper.h            |  4 --
>  include/drm/drm_modes.h                  |  2 +-
>  7 files changed, 28 insertions(+), 61 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> index 8c803e3af1da..2e86e3412623 100644
> --- a/drivers/gpu/drm/drm_modes.c
> +++ b/drivers/gpu/drm/drm_modes.c
> @@ -1171,7 +1171,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
> @@ -1180,8 +1179,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;
>  
> @@ -1214,14 +1212,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);
> diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
> index 2e0c8bfacd35..c4c5730db5d1 100644
> --- a/drivers/gpu/drm/drm_probe_helper.c
> +++ b/drivers/gpu/drm/drm_probe_helper.c
> @@ -126,9 +126,26 @@ 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 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 use as a generic implementation of the ->fill_modes()
> + * @connector vfunc for drivers that use the crtc helpers for output mode
> + * filtering and detection.
> + *
> + * 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;
> @@ -219,7 +236,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;
> @@ -263,49 +280,9 @@ prune:
>  
>  	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 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 use as a generic implementation of the ->fill_modes()
> - * @connector vfunc for drivers that use the crtc helpers for output mode
> - * filtering and detection.
> - *
> - * 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.
> - */
> -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
>   *
> diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
> index cddba079197f..7f9c0eb63169 100644
> --- a/drivers/gpu/drm/qxl/qxl_display.c
> +++ b/drivers/gpu/drm/qxl/qxl_display.c
> @@ -935,7 +935,7 @@ static const struct drm_connector_funcs qxl_connector_funcs = {
>  	.save = qxl_conn_save,
>  	.restore = qxl_conn_restore,
>  	.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,
>  };
> diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c
> index 8e6044d7660a..306a7df7d013 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_display.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_display.c
> @@ -412,7 +412,7 @@ static const struct drm_connector_funcs virtio_gpu_connector_funcs = {
>  	.save = virtio_gpu_conn_save,
>  	.restore = virtio_gpu_conn_restore,
>  	.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,
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> index e38db35132ed..808b247f3cfb 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> @@ -1554,7 +1554,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);
>  
> diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h
> index e22ab29d2d00..cb7bb91dc036 100644
> --- a/include/drm/drm_crtc_helper.h
> +++ b/include/drm/drm_crtc_helper.h
> @@ -229,10 +229,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);
> diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h
> index 256a1bbb125c..28023544e048 100644
> --- a/include/drm/drm_modes.h
> +++ b/include/drm/drm_modes.h
> @@ -234,7 +234,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
> -- 
> 2.4.10
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux