From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: <jani.nikula@linux.intel.com>, <joonas.lahtinen@linux.intel.com>,
<tursulin@ursulin.net>, <lucas.demarchi@intel.com>,
<thomas.hellstrom@linux.intel.com>, <simona@ffwll.ch>,
<airlied@gmail.com>, <mripard@kernel.org>,
<maarten.lankhorst@linux.intel.com>, <jfalempe@redhat.com>,
<javierm@redhat.com>, <intel-gfx@lists.freedesktop.org>,
<intel-xe@lists.freedesktop.org>,
<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 01/12] drm/{i915, xe}: Suspend/resume fbdev emulation via client interfaces
Date: Tue, 11 Feb 2025 15:55:57 -0500 [thread overview]
Message-ID: <Z6u5Xari1HKZ4gz8@intel.com> (raw)
In-Reply-To: <20241212170913.185939-2-tzimmermann@suse.de>
On Thu, Dec 12, 2024 at 06:08:42PM +0100, Thomas Zimmermann wrote:
> Implement drm_client_dev_suspend() and drm_client_dev_resume() for
> i915's fbdev emulation and call the helper via DRM client interfaces.
> This is required to convert i915 and xe to DRM's generic fbdev client.
> No functional changes.
Well, there is one functional change that is the clientlist iterator
and the clientlist_mutex hold. So I would avoid the statement of
no functional change. But indeed it seems there's not relevant
functional changes...
the code itself looks right to me:
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> drivers/gpu/drm/i915/display/intel_fbdev.c | 16 ++++++++++++++++
> drivers/gpu/drm/i915/i915_driver.c | 9 +++++----
> drivers/gpu/drm/xe/display/xe_display.c | 9 +++++----
> 3 files changed, 26 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
> index 00852ff5b247..a51d1dfd1b58 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
> @@ -642,11 +642,27 @@ static int intel_fbdev_client_hotplug(struct drm_client_dev *client)
> return ret;
> }
>
> +static int intel_fbdev_client_suspend(struct drm_client_dev *client, bool holds_console_lock)
> +{
> + intel_fbdev_set_suspend(client->dev, FBINFO_STATE_SUSPENDED, true);
> +
> + return 0;
> +}
> +
> +static int intel_fbdev_client_resume(struct drm_client_dev *client, bool holds_console_lock)
> +{
> + intel_fbdev_set_suspend(client->dev, FBINFO_STATE_RUNNING, false);
> +
> + return 0;
> +}
> +
> static const struct drm_client_funcs intel_fbdev_client_funcs = {
> .owner = THIS_MODULE,
> .unregister = intel_fbdev_client_unregister,
> .restore = intel_fbdev_client_restore,
> .hotplug = intel_fbdev_client_hotplug,
> + .suspend = intel_fbdev_client_suspend,
> + .resume = intel_fbdev_client_resume,
> };
>
> void intel_fbdev_setup(struct drm_i915_private *i915)
> diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
> index eb3fcc9e77a5..e385e4947a91 100644
> --- a/drivers/gpu/drm/i915/i915_driver.c
> +++ b/drivers/gpu/drm/i915/i915_driver.c
> @@ -41,6 +41,8 @@
> #include <linux/vt.h>
>
> #include <drm/drm_atomic_helper.h>
> +#include <drm/drm_client.h>
> +#include <drm/drm_client_event.h>
> #include <drm/drm_ioctl.h>
> #include <drm/drm_managed.h>
> #include <drm/drm_probe_helper.h>
> @@ -55,7 +57,6 @@
> #include "display/intel_dp.h"
> #include "display/intel_dpt.h"
> #include "display/intel_encoder.h"
> -#include "display/intel_fbdev.h"
> #include "display/intel_hotplug.h"
> #include "display/intel_overlay.h"
> #include "display/intel_pch_refclk.h"
> @@ -958,7 +959,7 @@ void i915_driver_shutdown(struct drm_i915_private *i915)
> intel_runtime_pm_disable(&i915->runtime_pm);
> intel_power_domains_disable(display);
>
> - intel_fbdev_set_suspend(&i915->drm, FBINFO_STATE_SUSPENDED, true);
> + drm_client_dev_suspend(&i915->drm, false);
> if (HAS_DISPLAY(i915)) {
> drm_kms_helper_poll_disable(&i915->drm);
> intel_display_driver_disable_user_access(display);
> @@ -1041,7 +1042,7 @@ static int i915_drm_suspend(struct drm_device *dev)
> /* We do a lot of poking in a lot of registers, make sure they work
> * properly. */
> intel_power_domains_disable(display);
> - intel_fbdev_set_suspend(dev, FBINFO_STATE_SUSPENDED, true);
> + drm_client_dev_suspend(dev, false);
> if (HAS_DISPLAY(dev_priv)) {
> drm_kms_helper_poll_disable(dev);
> intel_display_driver_disable_user_access(display);
> @@ -1227,7 +1228,7 @@ static int i915_drm_resume(struct drm_device *dev)
>
> intel_opregion_resume(display);
>
> - intel_fbdev_set_suspend(dev, FBINFO_STATE_RUNNING, false);
> + drm_client_dev_resume(dev, false);
>
> intel_power_domains_enable(display);
>
> diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c
> index 317fa66adf18..bc73c9999c57 100644
> --- a/drivers/gpu/drm/xe/display/xe_display.c
> +++ b/drivers/gpu/drm/xe/display/xe_display.c
> @@ -8,6 +8,8 @@
>
> #include <linux/fb.h>
>
> +#include <drm/drm_client.h>
> +#include <drm/drm_client_event.h>
> #include <drm/drm_drv.h>
> #include <drm/drm_managed.h>
> #include <drm/drm_probe_helper.h>
> @@ -25,7 +27,6 @@
> #include "intel_dmc_wl.h"
> #include "intel_dp.h"
> #include "intel_encoder.h"
> -#include "intel_fbdev.h"
> #include "intel_hdcp.h"
> #include "intel_hotplug.h"
> #include "intel_opregion.h"
> @@ -336,7 +337,7 @@ static void __xe_display_pm_suspend(struct xe_device *xe, bool runtime)
> */
> intel_power_domains_disable(display);
> if (!runtime)
> - intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_SUSPENDED, true);
> + drm_client_dev_suspend(&xe->drm, false);
>
> if (!runtime && has_display(xe)) {
> drm_kms_helper_poll_disable(&xe->drm);
> @@ -374,7 +375,7 @@ void xe_display_pm_shutdown(struct xe_device *xe)
> return;
>
> intel_power_domains_disable(display);
> - intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_SUSPENDED, true);
> + drm_client_dev_suspend(&xe->drm, false);
> if (has_display(xe)) {
> drm_kms_helper_poll_disable(&xe->drm);
> intel_display_driver_disable_user_access(display);
> @@ -494,7 +495,7 @@ static void __xe_display_pm_resume(struct xe_device *xe, bool runtime)
> intel_opregion_resume(display);
>
> if (!runtime)
> - intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_RUNNING, false);
> + drm_client_dev_resume(&xe->drm, false);
>
> intel_power_domains_enable(display);
> }
> --
> 2.47.1
>
next prev parent reply other threads:[~2025-02-11 20:56 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-12 17:08 [PATCH 00/12] drm/{i915,xe}: Convert to DRM client setup Thomas Zimmermann
2024-12-12 17:08 ` [PATCH 01/12] drm/{i915, xe}: Suspend/resume fbdev emulation via client interfaces Thomas Zimmermann
2025-02-11 20:55 ` Rodrigo Vivi [this message]
2025-02-12 7:43 ` Thomas Zimmermann
2024-12-12 17:08 ` [PATCH 02/12] drm/client: Add client-hotplug helper Thomas Zimmermann
2024-12-12 17:08 ` [PATCH 03/12] drm/client: Send pending hotplug events after resume Thomas Zimmermann
2024-12-12 17:08 ` [PATCH 04/12] drm/i915/display: Remove fbdev suspend and hotplug tracking Thomas Zimmermann
2024-12-12 17:08 ` [PATCH 05/12] drm/i915/display: fbdev: Move custom restore code to new callback Thomas Zimmermann
2024-12-12 17:08 ` [PATCH 06/12] drm/i915/display: fbdev: Move custom suspend " Thomas Zimmermann
2024-12-12 17:08 ` [PATCH 07/12] drm/i915/display: Remove preferred_bpp from struct intel_fbdev Thomas Zimmermann
2024-12-12 17:08 ` [PATCH 08/12] drm/i915/display: Remove struct drm_fb_helper " Thomas Zimmermann
2024-12-12 17:08 ` [PATCH 09/12] drm/i915/display: Move fbdev code around Thomas Zimmermann
2024-12-12 17:08 ` [PATCH 10/12] drm/{i915,xe}: Run DRM default client setup Thomas Zimmermann
2025-01-07 12:10 ` Jocelyn Falempe
2025-01-07 14:42 ` Thomas Zimmermann
2025-01-07 15:18 ` Jocelyn Falempe
2024-12-12 17:08 ` [PATCH 11/12] drm/i915/display: Remove compile guard around fbdev debugfs output Thomas Zimmermann
2024-12-12 17:08 ` [PATCH 12/12] drm/fb-helper: Remove struct drm_fb_helper.fb_probe Thomas Zimmermann
2024-12-12 17:53 ` ✓ CI.Patch_applied: success for drm/{i915,xe}: Convert to DRM client setup Patchwork
2024-12-12 17:53 ` ✓ CI.checkpatch: " Patchwork
2024-12-12 17:55 ` ✓ CI.KUnit: " Patchwork
2024-12-12 18:13 ` ✓ CI.Build: " Patchwork
2024-12-12 18:15 ` ✓ CI.Hooks: " Patchwork
2024-12-12 18:17 ` ✗ CI.checksparse: warning " Patchwork
2024-12-12 18:47 ` ✓ Xe.CI.BAT: success " Patchwork
2024-12-12 23:18 ` ✗ Xe.CI.Full: failure " Patchwork
2025-01-07 9:07 ` [PATCH 00/12] " Thomas Zimmermann
2025-02-11 7:17 ` Thomas Zimmermann
2025-02-12 7:28 ` Maarten Lankhorst
2025-02-12 7:42 ` Thomas Zimmermann
2025-02-28 8:49 ` Thomas Zimmermann
2025-03-04 19:40 ` Maarten Lankhorst
2025-03-04 21:38 ` Jocelyn Falempe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z6u5Xari1HKZ4gz8@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=javierm@redhat.com \
--cc=jfalempe@redhat.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=lucas.demarchi@intel.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=thomas.hellstrom@linux.intel.com \
--cc=tursulin@ursulin.net \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox