* [PATCH v2 0/3] DRM deadcode
@ 2024-10-29 23:47 linux
2024-10-29 23:47 ` [PATCH v2 1/3] drm: Remove unused drm_atomic_helper_commit_planes_on_crtc linux
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: linux @ 2024-10-29 23:47 UTC (permalink / raw)
To: dmitry.baryshkov, ville.syrjala, jfalempe, tomi.valkeinen,
maarten.lankhorst, mripard, tzimmermann, airlied, simona
Cc: dri-devel, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
This is a bunch of deadcode removals; the first two are
strictly whole function removals; the last as a revert
also undoes an extra parameter that was added. It was a clean
revert.
v2
Drop Remove unused drm_client_framebuffer_flush
Jocelyn & Thomas have plans for it
Drop Remove unused drm_crtc_vblank_count_and_time
Ville thinks it might be easy to make use of
Convert Remove unused drm_client_modeset_check
As suggested by Dmitry, make this a full revert
Dr. David Alan Gilbert (3):
drm: Remove unused drm_atomic_helper_commit_planes_on_crtc
drm/sysfs: Remove unused drm_class_device_(un)register
Revert "drm/client: Add drm_client_modeset_check()"
drivers/gpu/drm/drm_atomic_helper.c | 72 ----------------------------
drivers/gpu/drm/drm_client_modeset.c | 35 ++------------
drivers/gpu/drm/drm_sysfs.c | 32 -------------
include/drm/drm_atomic_helper.h | 1 -
include/drm/drm_client.h | 1 -
include/drm/drm_sysfs.h | 4 --
6 files changed, 4 insertions(+), 141 deletions(-)
--
2.47.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 1/3] drm: Remove unused drm_atomic_helper_commit_planes_on_crtc
2024-10-29 23:47 [PATCH v2 0/3] DRM deadcode linux
@ 2024-10-29 23:47 ` linux
2024-10-29 23:47 ` [PATCH v2 2/3] drm/sysfs: Remove unused drm_class_device_(un)register linux
2024-10-29 23:47 ` [PATCH v2 3/3] Revert "drm/client: Add drm_client_modeset_check()" linux
2 siblings, 0 replies; 7+ messages in thread
From: linux @ 2024-10-29 23:47 UTC (permalink / raw)
To: dmitry.baryshkov, ville.syrjala, jfalempe, tomi.valkeinen,
maarten.lankhorst, mripard, tzimmermann, airlied, simona
Cc: dri-devel, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
The last use of drm_atomic_helper_commit_planes_on_crtc() was removed
in 2018 by
commit 6c246b81f938 ("drm/i915: Replace call to commit_planes_on_crtc with
internal update, v2.")
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
drivers/gpu/drm/drm_atomic_helper.c | 72 -----------------------------
include/drm/drm_atomic_helper.h | 1 -
2 files changed, 73 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 43cdf39019a4..dd8f7d6f5a36 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -2705,8 +2705,6 @@ static bool plane_crtc_active(const struct drm_plane_state *state)
* crtcs need to be updated though.
*
* Note that this function does all plane updates across all CRTCs in one step.
- * If the hardware can't support this approach look at
- * drm_atomic_helper_commit_planes_on_crtc() instead.
*
* Plane parameters can be updated by applications while the associated CRTC is
* disabled. The DRM/KMS core will store the parameters in the plane state,
@@ -2833,76 +2831,6 @@ void drm_atomic_helper_commit_planes(struct drm_device *dev,
}
EXPORT_SYMBOL(drm_atomic_helper_commit_planes);
-/**
- * drm_atomic_helper_commit_planes_on_crtc - commit plane state for a CRTC
- * @old_crtc_state: atomic state object with the old CRTC state
- *
- * This function commits the new plane state using the plane and atomic helper
- * functions for planes on the specific CRTC. It assumes that the atomic state
- * has already been pushed into the relevant object state pointers, since this
- * step can no longer fail.
- *
- * This function is useful when plane updates should be done CRTC-by-CRTC
- * instead of one global step like drm_atomic_helper_commit_planes() does.
- *
- * This function can only be savely used when planes are not allowed to move
- * between different CRTCs because this function doesn't handle inter-CRTC
- * dependencies. Callers need to ensure that either no such dependencies exist,
- * resolve them through ordering of commit calls or through some other means.
- */
-void
-drm_atomic_helper_commit_planes_on_crtc(struct drm_crtc_state *old_crtc_state)
-{
- const struct drm_crtc_helper_funcs *crtc_funcs;
- struct drm_crtc *crtc = old_crtc_state->crtc;
- struct drm_atomic_state *old_state = old_crtc_state->state;
- struct drm_crtc_state *new_crtc_state =
- drm_atomic_get_new_crtc_state(old_state, crtc);
- struct drm_plane *plane;
- unsigned int plane_mask;
-
- plane_mask = old_crtc_state->plane_mask;
- plane_mask |= new_crtc_state->plane_mask;
-
- crtc_funcs = crtc->helper_private;
- if (crtc_funcs && crtc_funcs->atomic_begin)
- crtc_funcs->atomic_begin(crtc, old_state);
-
- drm_for_each_plane_mask(plane, crtc->dev, plane_mask) {
- struct drm_plane_state *old_plane_state =
- drm_atomic_get_old_plane_state(old_state, plane);
- struct drm_plane_state *new_plane_state =
- drm_atomic_get_new_plane_state(old_state, plane);
- const struct drm_plane_helper_funcs *plane_funcs;
- bool disabling;
-
- plane_funcs = plane->helper_private;
-
- if (!old_plane_state || !plane_funcs)
- continue;
-
- WARN_ON(new_plane_state->crtc &&
- new_plane_state->crtc != crtc);
-
- disabling = drm_atomic_plane_disabling(old_plane_state, new_plane_state);
-
- if (disabling && plane_funcs->atomic_disable) {
- plane_funcs->atomic_disable(plane, old_state);
- } else if (new_plane_state->crtc || disabling) {
- plane_funcs->atomic_update(plane, old_state);
-
- if (!disabling && plane_funcs->atomic_enable) {
- if (drm_atomic_plane_enabling(old_plane_state, new_plane_state))
- plane_funcs->atomic_enable(plane, old_state);
- }
- }
- }
-
- if (crtc_funcs && crtc_funcs->atomic_flush)
- crtc_funcs->atomic_flush(crtc, old_state);
-}
-EXPORT_SYMBOL(drm_atomic_helper_commit_planes_on_crtc);
-
/**
* drm_atomic_helper_disable_planes_on_crtc - helper to disable CRTC's planes
* @old_crtc_state: atomic state object with the old CRTC state
diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h
index 9aa0a05aa072..6ad50c531fc0 100644
--- a/include/drm/drm_atomic_helper.h
+++ b/include/drm/drm_atomic_helper.h
@@ -107,7 +107,6 @@ void drm_atomic_helper_commit_planes(struct drm_device *dev,
uint32_t flags);
void drm_atomic_helper_cleanup_planes(struct drm_device *dev,
struct drm_atomic_state *old_state);
-void drm_atomic_helper_commit_planes_on_crtc(struct drm_crtc_state *old_crtc_state);
void
drm_atomic_helper_disable_planes_on_crtc(struct drm_crtc_state *old_crtc_state,
bool atomic);
--
2.47.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 2/3] drm/sysfs: Remove unused drm_class_device_(un)register
2024-10-29 23:47 [PATCH v2 0/3] DRM deadcode linux
2024-10-29 23:47 ` [PATCH v2 1/3] drm: Remove unused drm_atomic_helper_commit_planes_on_crtc linux
@ 2024-10-29 23:47 ` linux
2024-10-29 23:47 ` [PATCH v2 3/3] Revert "drm/client: Add drm_client_modeset_check()" linux
2 siblings, 0 replies; 7+ messages in thread
From: linux @ 2024-10-29 23:47 UTC (permalink / raw)
To: dmitry.baryshkov, ville.syrjala, jfalempe, tomi.valkeinen,
maarten.lankhorst, mripard, tzimmermann, airlied, simona
Cc: dri-devel, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
drm_class_device_register() and drm_class_device_unregister() have been
unused since
commit ed89fff97382 ("drm/ttm: drop sysfs directory")
Remove them.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
drivers/gpu/drm/drm_sysfs.c | 32 --------------------------------
include/drm/drm_sysfs.h | 4 ----
2 files changed, 36 deletions(-)
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
index fb3bbb6adcd1..3bc90fe5cea3 100644
--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
@@ -548,35 +548,3 @@ struct device *drm_sysfs_minor_alloc(struct drm_minor *minor)
put_device(kdev);
return ERR_PTR(r);
}
-
-/**
- * drm_class_device_register - register new device with the DRM sysfs class
- * @dev: device to register
- *
- * Registers a new &struct device within the DRM sysfs class. Essentially only
- * used by ttm to have a place for its global settings. Drivers should never use
- * this.
- */
-int drm_class_device_register(struct device *dev)
-{
- if (!drm_class || IS_ERR(drm_class))
- return -ENOENT;
-
- dev->class = drm_class;
- return device_register(dev);
-}
-EXPORT_SYMBOL_GPL(drm_class_device_register);
-
-/**
- * drm_class_device_unregister - unregister device with the DRM sysfs class
- * @dev: device to unregister
- *
- * Unregisters a &struct device from the DRM sysfs class. Essentially only used
- * by ttm to have a place for its global settings. Drivers should never use
- * this.
- */
-void drm_class_device_unregister(struct device *dev)
-{
- return device_unregister(dev);
-}
-EXPORT_SYMBOL_GPL(drm_class_device_unregister);
diff --git a/include/drm/drm_sysfs.h b/include/drm/drm_sysfs.h
index 96a5d858404b..7695873a9456 100644
--- a/include/drm/drm_sysfs.h
+++ b/include/drm/drm_sysfs.h
@@ -3,13 +3,9 @@
#define _DRM_SYSFS_H_
struct drm_device;
-struct device;
struct drm_connector;
struct drm_property;
-int drm_class_device_register(struct device *dev);
-void drm_class_device_unregister(struct device *dev);
-
void drm_sysfs_hotplug_event(struct drm_device *dev);
void drm_sysfs_connector_hotplug_event(struct drm_connector *connector);
void drm_sysfs_connector_property_event(struct drm_connector *connector,
--
2.47.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 3/3] Revert "drm/client: Add drm_client_modeset_check()"
2024-10-29 23:47 [PATCH v2 0/3] DRM deadcode linux
2024-10-29 23:47 ` [PATCH v2 1/3] drm: Remove unused drm_atomic_helper_commit_planes_on_crtc linux
2024-10-29 23:47 ` [PATCH v2 2/3] drm/sysfs: Remove unused drm_class_device_(un)register linux
@ 2024-10-29 23:47 ` linux
2024-10-31 21:47 ` Dmitry Baryshkov
2 siblings, 1 reply; 7+ messages in thread
From: linux @ 2024-10-29 23:47 UTC (permalink / raw)
To: dmitry.baryshkov, ville.syrjala, jfalempe, tomi.valkeinen,
maarten.lankhorst, mripard, tzimmermann, airlied, simona
Cc: dri-devel, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
drm_client_modeset_check() was explicitly added in 2020 by
commit 64593f2a6fc9 ("drm/client: Add drm_client_modeset_check()")
but has never been used.
This reverts commit 64593f2a6fc933bb9a410bc3f8c261f3e57a9601.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/gpu/drm/drm_client_modeset.c | 35 ++++------------------------
include/drm/drm_client.h | 1 -
2 files changed, 4 insertions(+), 32 deletions(-)
diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c
index cee5eafbfb81..39201c11eaac 100644
--- a/drivers/gpu/drm/drm_client_modeset.c
+++ b/drivers/gpu/drm/drm_client_modeset.c
@@ -995,7 +995,7 @@ bool drm_client_rotation(struct drm_mode_set *modeset, unsigned int *rotation)
}
EXPORT_SYMBOL(drm_client_rotation);
-static int drm_client_modeset_commit_atomic(struct drm_client_dev *client, bool active, bool check)
+static int drm_client_modeset_commit_atomic(struct drm_client_dev *client, bool active)
{
struct drm_device *dev = client->dev;
struct drm_plane *plane;
@@ -1062,10 +1062,7 @@ static int drm_client_modeset_commit_atomic(struct drm_client_dev *client, bool
}
}
- if (check)
- ret = drm_atomic_check_only(state);
- else
- ret = drm_atomic_commit(state);
+ ret = drm_atomic_commit(state);
out_state:
if (ret == -EDEADLK)
@@ -1126,30 +1123,6 @@ static int drm_client_modeset_commit_legacy(struct drm_client_dev *client)
return ret;
}
-/**
- * drm_client_modeset_check() - Check modeset configuration
- * @client: DRM client
- *
- * Check modeset configuration.
- *
- * Returns:
- * Zero on success or negative error code on failure.
- */
-int drm_client_modeset_check(struct drm_client_dev *client)
-{
- int ret;
-
- if (!drm_drv_uses_atomic_modeset(client->dev))
- return 0;
-
- mutex_lock(&client->modeset_mutex);
- ret = drm_client_modeset_commit_atomic(client, true, true);
- mutex_unlock(&client->modeset_mutex);
-
- return ret;
-}
-EXPORT_SYMBOL(drm_client_modeset_check);
-
/**
* drm_client_modeset_commit_locked() - Force commit CRTC configuration
* @client: DRM client
@@ -1168,7 +1141,7 @@ int drm_client_modeset_commit_locked(struct drm_client_dev *client)
mutex_lock(&client->modeset_mutex);
if (drm_drv_uses_atomic_modeset(dev))
- ret = drm_client_modeset_commit_atomic(client, true, false);
+ ret = drm_client_modeset_commit_atomic(client, true);
else
ret = drm_client_modeset_commit_legacy(client);
mutex_unlock(&client->modeset_mutex);
@@ -1246,7 +1219,7 @@ int drm_client_modeset_dpms(struct drm_client_dev *client, int mode)
mutex_lock(&client->modeset_mutex);
if (drm_drv_uses_atomic_modeset(dev))
- ret = drm_client_modeset_commit_atomic(client, mode == DRM_MODE_DPMS_ON, false);
+ ret = drm_client_modeset_commit_atomic(client, mode == DRM_MODE_DPMS_ON);
else
drm_client_modeset_dpms_legacy(client, mode);
mutex_unlock(&client->modeset_mutex);
diff --git a/include/drm/drm_client.h b/include/drm/drm_client.h
index bc0e66f9c425..ead3c3526ee3 100644
--- a/include/drm/drm_client.h
+++ b/include/drm/drm_client.h
@@ -177,7 +177,6 @@ int drm_client_modeset_create(struct drm_client_dev *client);
void drm_client_modeset_free(struct drm_client_dev *client);
int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width, unsigned int height);
bool drm_client_rotation(struct drm_mode_set *modeset, unsigned int *rotation);
-int drm_client_modeset_check(struct drm_client_dev *client);
int drm_client_modeset_commit_locked(struct drm_client_dev *client);
int drm_client_modeset_commit(struct drm_client_dev *client);
int drm_client_modeset_dpms(struct drm_client_dev *client, int mode);
--
2.47.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2 3/3] Revert "drm/client: Add drm_client_modeset_check()"
2024-10-29 23:47 ` [PATCH v2 3/3] Revert "drm/client: Add drm_client_modeset_check()" linux
@ 2024-10-31 21:47 ` Dmitry Baryshkov
2025-01-31 12:56 ` Dr. David Alan Gilbert
2025-03-03 16:58 ` Dr. David Alan Gilbert
0 siblings, 2 replies; 7+ messages in thread
From: Dmitry Baryshkov @ 2024-10-31 21:47 UTC (permalink / raw)
To: linux
Cc: ville.syrjala, jfalempe, tomi.valkeinen, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, dri-devel, linux-kernel
On Tue, Oct 29, 2024 at 11:47:05PM +0000, linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> drm_client_modeset_check() was explicitly added in 2020 by
> commit 64593f2a6fc9 ("drm/client: Add drm_client_modeset_check()")
> but has never been used.
>
> This reverts commit 64593f2a6fc933bb9a410bc3f8c261f3e57a9601.
Nit: Usually this comes before the commit message. No need for repost
though.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> ---
> drivers/gpu/drm/drm_client_modeset.c | 35 ++++------------------------
> include/drm/drm_client.h | 1 -
> 2 files changed, 4 insertions(+), 32 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c
> index cee5eafbfb81..39201c11eaac 100644
> --- a/drivers/gpu/drm/drm_client_modeset.c
> +++ b/drivers/gpu/drm/drm_client_modeset.c
> @@ -995,7 +995,7 @@ bool drm_client_rotation(struct drm_mode_set *modeset, unsigned int *rotation)
> }
> EXPORT_SYMBOL(drm_client_rotation);
>
> -static int drm_client_modeset_commit_atomic(struct drm_client_dev *client, bool active, bool check)
> +static int drm_client_modeset_commit_atomic(struct drm_client_dev *client, bool active)
> {
> struct drm_device *dev = client->dev;
> struct drm_plane *plane;
> @@ -1062,10 +1062,7 @@ static int drm_client_modeset_commit_atomic(struct drm_client_dev *client, bool
> }
> }
>
> - if (check)
> - ret = drm_atomic_check_only(state);
> - else
> - ret = drm_atomic_commit(state);
> + ret = drm_atomic_commit(state);
>
> out_state:
> if (ret == -EDEADLK)
> @@ -1126,30 +1123,6 @@ static int drm_client_modeset_commit_legacy(struct drm_client_dev *client)
> return ret;
> }
>
> -/**
> - * drm_client_modeset_check() - Check modeset configuration
> - * @client: DRM client
> - *
> - * Check modeset configuration.
> - *
> - * Returns:
> - * Zero on success or negative error code on failure.
> - */
> -int drm_client_modeset_check(struct drm_client_dev *client)
> -{
> - int ret;
> -
> - if (!drm_drv_uses_atomic_modeset(client->dev))
> - return 0;
> -
> - mutex_lock(&client->modeset_mutex);
> - ret = drm_client_modeset_commit_atomic(client, true, true);
> - mutex_unlock(&client->modeset_mutex);
> -
> - return ret;
> -}
> -EXPORT_SYMBOL(drm_client_modeset_check);
> -
> /**
> * drm_client_modeset_commit_locked() - Force commit CRTC configuration
> * @client: DRM client
> @@ -1168,7 +1141,7 @@ int drm_client_modeset_commit_locked(struct drm_client_dev *client)
>
> mutex_lock(&client->modeset_mutex);
> if (drm_drv_uses_atomic_modeset(dev))
> - ret = drm_client_modeset_commit_atomic(client, true, false);
> + ret = drm_client_modeset_commit_atomic(client, true);
> else
> ret = drm_client_modeset_commit_legacy(client);
> mutex_unlock(&client->modeset_mutex);
> @@ -1246,7 +1219,7 @@ int drm_client_modeset_dpms(struct drm_client_dev *client, int mode)
>
> mutex_lock(&client->modeset_mutex);
> if (drm_drv_uses_atomic_modeset(dev))
> - ret = drm_client_modeset_commit_atomic(client, mode == DRM_MODE_DPMS_ON, false);
> + ret = drm_client_modeset_commit_atomic(client, mode == DRM_MODE_DPMS_ON);
> else
> drm_client_modeset_dpms_legacy(client, mode);
> mutex_unlock(&client->modeset_mutex);
> diff --git a/include/drm/drm_client.h b/include/drm/drm_client.h
> index bc0e66f9c425..ead3c3526ee3 100644
> --- a/include/drm/drm_client.h
> +++ b/include/drm/drm_client.h
> @@ -177,7 +177,6 @@ int drm_client_modeset_create(struct drm_client_dev *client);
> void drm_client_modeset_free(struct drm_client_dev *client);
> int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width, unsigned int height);
> bool drm_client_rotation(struct drm_mode_set *modeset, unsigned int *rotation);
> -int drm_client_modeset_check(struct drm_client_dev *client);
> int drm_client_modeset_commit_locked(struct drm_client_dev *client);
> int drm_client_modeset_commit(struct drm_client_dev *client);
> int drm_client_modeset_dpms(struct drm_client_dev *client, int mode);
> --
> 2.47.0
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 3/3] Revert "drm/client: Add drm_client_modeset_check()"
2024-10-31 21:47 ` Dmitry Baryshkov
@ 2025-01-31 12:56 ` Dr. David Alan Gilbert
2025-03-03 16:58 ` Dr. David Alan Gilbert
1 sibling, 0 replies; 7+ messages in thread
From: Dr. David Alan Gilbert @ 2025-01-31 12:56 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: ville.syrjala, jfalempe, tomi.valkeinen, maarten.lankhorst,
mripard, tzimmermann, airlied, simona, dri-devel, linux-kernel
* Dmitry Baryshkov (dmitry.baryshkov@linaro.org) wrote:
> On Tue, Oct 29, 2024 at 11:47:05PM +0000, linux@treblig.org wrote:
> > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> >
> > drm_client_modeset_check() was explicitly added in 2020 by
> > commit 64593f2a6fc9 ("drm/client: Add drm_client_modeset_check()")
> > but has never been used.
> >
> > This reverts commit 64593f2a6fc933bb9a410bc3f8c261f3e57a9601.
>
> Nit: Usually this comes before the commit message. No need for repost
> though.
>
>
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Hi,
Just checking, has anyone got this in a pull?
Dmitry's review was at the end of October.
(There's also a few others that Dmitry was kind enough to review
still outstanding:
drm: encoder_slave: Remove unused encoder functions
and
gpu: ipu-v3: Remove unused functions
)
(There's also drm/i915/gvt: Remove intel_gvt_ggtt_h2g<->index
and co that I've seen in Next but not in a pull yet)
Thanks,
Dave
>
>
> >
> > Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> > ---
> > drivers/gpu/drm/drm_client_modeset.c | 35 ++++------------------------
> > include/drm/drm_client.h | 1 -
> > 2 files changed, 4 insertions(+), 32 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c
> > index cee5eafbfb81..39201c11eaac 100644
> > --- a/drivers/gpu/drm/drm_client_modeset.c
> > +++ b/drivers/gpu/drm/drm_client_modeset.c
> > @@ -995,7 +995,7 @@ bool drm_client_rotation(struct drm_mode_set *modeset, unsigned int *rotation)
> > }
> > EXPORT_SYMBOL(drm_client_rotation);
> >
> > -static int drm_client_modeset_commit_atomic(struct drm_client_dev *client, bool active, bool check)
> > +static int drm_client_modeset_commit_atomic(struct drm_client_dev *client, bool active)
> > {
> > struct drm_device *dev = client->dev;
> > struct drm_plane *plane;
> > @@ -1062,10 +1062,7 @@ static int drm_client_modeset_commit_atomic(struct drm_client_dev *client, bool
> > }
> > }
> >
> > - if (check)
> > - ret = drm_atomic_check_only(state);
> > - else
> > - ret = drm_atomic_commit(state);
> > + ret = drm_atomic_commit(state);
> >
> > out_state:
> > if (ret == -EDEADLK)
> > @@ -1126,30 +1123,6 @@ static int drm_client_modeset_commit_legacy(struct drm_client_dev *client)
> > return ret;
> > }
> >
> > -/**
> > - * drm_client_modeset_check() - Check modeset configuration
> > - * @client: DRM client
> > - *
> > - * Check modeset configuration.
> > - *
> > - * Returns:
> > - * Zero on success or negative error code on failure.
> > - */
> > -int drm_client_modeset_check(struct drm_client_dev *client)
> > -{
> > - int ret;
> > -
> > - if (!drm_drv_uses_atomic_modeset(client->dev))
> > - return 0;
> > -
> > - mutex_lock(&client->modeset_mutex);
> > - ret = drm_client_modeset_commit_atomic(client, true, true);
> > - mutex_unlock(&client->modeset_mutex);
> > -
> > - return ret;
> > -}
> > -EXPORT_SYMBOL(drm_client_modeset_check);
> > -
> > /**
> > * drm_client_modeset_commit_locked() - Force commit CRTC configuration
> > * @client: DRM client
> > @@ -1168,7 +1141,7 @@ int drm_client_modeset_commit_locked(struct drm_client_dev *client)
> >
> > mutex_lock(&client->modeset_mutex);
> > if (drm_drv_uses_atomic_modeset(dev))
> > - ret = drm_client_modeset_commit_atomic(client, true, false);
> > + ret = drm_client_modeset_commit_atomic(client, true);
> > else
> > ret = drm_client_modeset_commit_legacy(client);
> > mutex_unlock(&client->modeset_mutex);
> > @@ -1246,7 +1219,7 @@ int drm_client_modeset_dpms(struct drm_client_dev *client, int mode)
> >
> > mutex_lock(&client->modeset_mutex);
> > if (drm_drv_uses_atomic_modeset(dev))
> > - ret = drm_client_modeset_commit_atomic(client, mode == DRM_MODE_DPMS_ON, false);
> > + ret = drm_client_modeset_commit_atomic(client, mode == DRM_MODE_DPMS_ON);
> > else
> > drm_client_modeset_dpms_legacy(client, mode);
> > mutex_unlock(&client->modeset_mutex);
> > diff --git a/include/drm/drm_client.h b/include/drm/drm_client.h
> > index bc0e66f9c425..ead3c3526ee3 100644
> > --- a/include/drm/drm_client.h
> > +++ b/include/drm/drm_client.h
> > @@ -177,7 +177,6 @@ int drm_client_modeset_create(struct drm_client_dev *client);
> > void drm_client_modeset_free(struct drm_client_dev *client);
> > int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width, unsigned int height);
> > bool drm_client_rotation(struct drm_mode_set *modeset, unsigned int *rotation);
> > -int drm_client_modeset_check(struct drm_client_dev *client);
> > int drm_client_modeset_commit_locked(struct drm_client_dev *client);
> > int drm_client_modeset_commit(struct drm_client_dev *client);
> > int drm_client_modeset_dpms(struct drm_client_dev *client, int mode);
> > --
> > 2.47.0
> >
>
> --
> With best wishes
> Dmitry
>
--
-----Open up your eyes, open up your mind, open up your code -------
/ Dr. David Alan Gilbert | Running GNU/Linux | Happy \
\ dave @ treblig.org | | In Hex /
\ _________________________|_____ http://www.treblig.org |_______/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 3/3] Revert "drm/client: Add drm_client_modeset_check()"
2024-10-31 21:47 ` Dmitry Baryshkov
2025-01-31 12:56 ` Dr. David Alan Gilbert
@ 2025-03-03 16:58 ` Dr. David Alan Gilbert
1 sibling, 0 replies; 7+ messages in thread
From: Dr. David Alan Gilbert @ 2025-03-03 16:58 UTC (permalink / raw)
To: Dmitry Baryshkov, tzimmermann, airlied, simona
Cc: ville.syrjala, jfalempe, tomi.valkeinen, maarten.lankhorst,
mripard, dri-devel, linux-kernel
* Dmitry Baryshkov (dmitry.baryshkov@linaro.org) wrote:
> On Tue, Oct 29, 2024 at 11:47:05PM +0000, linux@treblig.org wrote:
> > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> >
> > drm_client_modeset_check() was explicitly added in 2020 by
> > commit 64593f2a6fc9 ("drm/client: Add drm_client_modeset_check()")
> > but has never been used.
> >
> > This reverts commit 64593f2a6fc933bb9a410bc3f8c261f3e57a9601.
>
> Nit: Usually this comes before the commit message. No need for repost
> though.
>
>
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Hi,
Can drm pick this up please?
Thanks,
Dave
>
> >
> > Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> > ---
> > drivers/gpu/drm/drm_client_modeset.c | 35 ++++------------------------
> > include/drm/drm_client.h | 1 -
> > 2 files changed, 4 insertions(+), 32 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c
> > index cee5eafbfb81..39201c11eaac 100644
> > --- a/drivers/gpu/drm/drm_client_modeset.c
> > +++ b/drivers/gpu/drm/drm_client_modeset.c
> > @@ -995,7 +995,7 @@ bool drm_client_rotation(struct drm_mode_set *modeset, unsigned int *rotation)
> > }
> > EXPORT_SYMBOL(drm_client_rotation);
> >
> > -static int drm_client_modeset_commit_atomic(struct drm_client_dev *client, bool active, bool check)
> > +static int drm_client_modeset_commit_atomic(struct drm_client_dev *client, bool active)
> > {
> > struct drm_device *dev = client->dev;
> > struct drm_plane *plane;
> > @@ -1062,10 +1062,7 @@ static int drm_client_modeset_commit_atomic(struct drm_client_dev *client, bool
> > }
> > }
> >
> > - if (check)
> > - ret = drm_atomic_check_only(state);
> > - else
> > - ret = drm_atomic_commit(state);
> > + ret = drm_atomic_commit(state);
> >
> > out_state:
> > if (ret == -EDEADLK)
> > @@ -1126,30 +1123,6 @@ static int drm_client_modeset_commit_legacy(struct drm_client_dev *client)
> > return ret;
> > }
> >
> > -/**
> > - * drm_client_modeset_check() - Check modeset configuration
> > - * @client: DRM client
> > - *
> > - * Check modeset configuration.
> > - *
> > - * Returns:
> > - * Zero on success or negative error code on failure.
> > - */
> > -int drm_client_modeset_check(struct drm_client_dev *client)
> > -{
> > - int ret;
> > -
> > - if (!drm_drv_uses_atomic_modeset(client->dev))
> > - return 0;
> > -
> > - mutex_lock(&client->modeset_mutex);
> > - ret = drm_client_modeset_commit_atomic(client, true, true);
> > - mutex_unlock(&client->modeset_mutex);
> > -
> > - return ret;
> > -}
> > -EXPORT_SYMBOL(drm_client_modeset_check);
> > -
> > /**
> > * drm_client_modeset_commit_locked() - Force commit CRTC configuration
> > * @client: DRM client
> > @@ -1168,7 +1141,7 @@ int drm_client_modeset_commit_locked(struct drm_client_dev *client)
> >
> > mutex_lock(&client->modeset_mutex);
> > if (drm_drv_uses_atomic_modeset(dev))
> > - ret = drm_client_modeset_commit_atomic(client, true, false);
> > + ret = drm_client_modeset_commit_atomic(client, true);
> > else
> > ret = drm_client_modeset_commit_legacy(client);
> > mutex_unlock(&client->modeset_mutex);
> > @@ -1246,7 +1219,7 @@ int drm_client_modeset_dpms(struct drm_client_dev *client, int mode)
> >
> > mutex_lock(&client->modeset_mutex);
> > if (drm_drv_uses_atomic_modeset(dev))
> > - ret = drm_client_modeset_commit_atomic(client, mode == DRM_MODE_DPMS_ON, false);
> > + ret = drm_client_modeset_commit_atomic(client, mode == DRM_MODE_DPMS_ON);
> > else
> > drm_client_modeset_dpms_legacy(client, mode);
> > mutex_unlock(&client->modeset_mutex);
> > diff --git a/include/drm/drm_client.h b/include/drm/drm_client.h
> > index bc0e66f9c425..ead3c3526ee3 100644
> > --- a/include/drm/drm_client.h
> > +++ b/include/drm/drm_client.h
> > @@ -177,7 +177,6 @@ int drm_client_modeset_create(struct drm_client_dev *client);
> > void drm_client_modeset_free(struct drm_client_dev *client);
> > int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width, unsigned int height);
> > bool drm_client_rotation(struct drm_mode_set *modeset, unsigned int *rotation);
> > -int drm_client_modeset_check(struct drm_client_dev *client);
> > int drm_client_modeset_commit_locked(struct drm_client_dev *client);
> > int drm_client_modeset_commit(struct drm_client_dev *client);
> > int drm_client_modeset_dpms(struct drm_client_dev *client, int mode);
> > --
> > 2.47.0
> >
>
> --
> With best wishes
> Dmitry
>
--
-----Open up your eyes, open up your mind, open up your code -------
/ Dr. David Alan Gilbert | Running GNU/Linux | Happy \
\ dave @ treblig.org | | In Hex /
\ _________________________|_____ http://www.treblig.org |_______/
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-03-03 16:58 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-29 23:47 [PATCH v2 0/3] DRM deadcode linux
2024-10-29 23:47 ` [PATCH v2 1/3] drm: Remove unused drm_atomic_helper_commit_planes_on_crtc linux
2024-10-29 23:47 ` [PATCH v2 2/3] drm/sysfs: Remove unused drm_class_device_(un)register linux
2024-10-29 23:47 ` [PATCH v2 3/3] Revert "drm/client: Add drm_client_modeset_check()" linux
2024-10-31 21:47 ` Dmitry Baryshkov
2025-01-31 12:56 ` Dr. David Alan Gilbert
2025-03-03 16:58 ` Dr. David Alan Gilbert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox