From: "Hogander, Jouni" <jouni.hogander@intel.com>
To: "Upadhyay, Tejas" <tejas.upadhyay@intel.com>,
"tzimmermann@suse.de" <tzimmermann@suse.de>,
"ville.syrjala@linux.intel.com" <ville.syrjala@linux.intel.com>,
"Vivi, Rodrigo" <rodrigo.vivi@intel.com>,
"joonas.lahtinen@linux.intel.com"
<joonas.lahtinen@linux.intel.com>,
"javierm@redhat.com" <javierm@redhat.com>,
"tvrtko.ursulin@linux.intel.com" <tvrtko.ursulin@linux.intel.com>,
"Deak, Imre" <imre.deak@intel.com>,
"airlied@gmail.com" <airlied@gmail.com>,
"jani.nikula@linux.intel.com" <jani.nikula@linux.intel.com>,
"daniel@ffwll.ch" <daniel@ffwll.ch>
Cc: "intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH v5 6/7] drm/i915: Implement fbdev client callbacks
Date: Wed, 25 Oct 2023 09:36:12 +0000 [thread overview]
Message-ID: <07431faca53e93e502006484c362ce08d36a6335.camel@intel.com> (raw)
In-Reply-To: <20230927102808.18650-7-tzimmermann@suse.de>
Hi Thomas, couple of inline commments/suggestions below.
On Wed, 2023-09-27 at 12:26 +0200, Thomas Zimmermann wrote:
> Move code from ad-hoc fbdev callbacks into DRM client functions
> and remove the old callbacks. The functions instruct the client
> to poll for changed output or restore the display.
>
> The DRM core calls both, the old callbacks and the new client
> helpers, from the same places. The new functions perform the same
> operation as before, so there's no change in functionality.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> .../drm/i915/display/intel_display_driver.c | 1 -
> drivers/gpu/drm/i915/display/intel_fbdev.c | 11 ++++++++--
> drivers/gpu/drm/i915/display/intel_fbdev.h | 9 --------
> drivers/gpu/drm/i915/i915_driver.c | 22 -----------------
> --
> 4 files changed, 9 insertions(+), 34 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_driver.c
> b/drivers/gpu/drm/i915/display/intel_display_driver.c
> index 44b59ac301e69..ffdcddd1943e0 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_driver.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_driver.c
> @@ -96,7 +96,6 @@ void intel_display_driver_init_hw(struct
> drm_i915_private *i915)
> static const struct drm_mode_config_funcs intel_mode_funcs = {
> .fb_create = intel_user_framebuffer_create,
> .get_format_info = intel_fb_get_format_info,
> - .output_poll_changed = intel_fbdev_output_poll_changed,
> .mode_valid = intel_mode_valid,
> .atomic_check = intel_atomic_check,
> .atomic_commit = intel_atomic_commit,
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c
> b/drivers/gpu/drm/i915/display/intel_fbdev.c
> index d9e69471a782a..39de61d4e7906 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
> @@ -638,7 +638,7 @@ void intel_fbdev_set_suspend(struct drm_device
> *dev, int state, bool synchronous
> intel_fbdev_hpd_set_suspend(dev_priv, state);
> }
>
> -void intel_fbdev_output_poll_changed(struct drm_device *dev)
> +static void intel_fbdev_output_poll_changed(struct drm_device *dev)
Now as this isn't drm_mode_config_funcs callback anymore: Maybe you
could return error value/0 ?
> {
> struct intel_fbdev *ifbdev = to_i915(dev)-
> >display.fbdev.fbdev;
> bool send_hpd;
> @@ -657,7 +657,7 @@ void intel_fbdev_output_poll_changed(struct
> drm_device *dev)
> drm_fb_helper_hotplug_event(&ifbdev->helper);
> }
>
> -void intel_fbdev_restore_mode(struct drm_i915_private *dev_priv)
> +static void intel_fbdev_restore_mode(struct drm_i915_private
Similar comment as above. I.e. return error value/0 ?
BR,
Jouni Högander
> *dev_priv)
> {
> struct intel_fbdev *ifbdev = dev_priv->display.fbdev.fbdev;
>
> @@ -681,11 +681,18 @@ static void
> intel_fbdev_client_unregister(struct drm_client_dev *client)
>
> static int intel_fbdev_client_restore(struct drm_client_dev *client)
> {
> + struct drm_i915_private *dev_priv = to_i915(client->dev);
> +
> + intel_fbdev_restore_mode(dev_priv);
> + vga_switcheroo_process_delayed_switch();
> +
> return 0;
> }
>
> static int intel_fbdev_client_hotplug(struct drm_client_dev *client)
> {
> + intel_fbdev_output_poll_changed(client->dev);
> +
> return 0;
> }
>
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.h
> b/drivers/gpu/drm/i915/display/intel_fbdev.h
> index 04fd523a50232..8c953f102ba22 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev.h
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.h
> @@ -19,8 +19,6 @@ void intel_fbdev_initial_config_async(struct
> drm_i915_private *dev_priv);
> void intel_fbdev_unregister(struct drm_i915_private *dev_priv);
> void intel_fbdev_fini(struct drm_i915_private *dev_priv);
> void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool
> synchronous);
> -void intel_fbdev_output_poll_changed(struct drm_device *dev);
> -void intel_fbdev_restore_mode(struct drm_i915_private *dev_priv);
> struct intel_framebuffer *intel_fbdev_framebuffer(struct intel_fbdev
> *fbdev);
> #else
> static inline int intel_fbdev_init(struct drm_device *dev)
> @@ -44,13 +42,6 @@ static inline void intel_fbdev_set_suspend(struct
> drm_device *dev, int state, bo
> {
> }
>
> -static inline void intel_fbdev_output_poll_changed(struct drm_device
> *dev)
> -{
> -}
> -
> -static inline void intel_fbdev_restore_mode(struct drm_i915_private
> *i915)
> -{
> -}
> static inline struct intel_framebuffer
> *intel_fbdev_framebuffer(struct intel_fbdev *fbdev)
> {
> return NULL;
> diff --git a/drivers/gpu/drm/i915/i915_driver.c
> b/drivers/gpu/drm/i915/i915_driver.c
> index de19197d2e052..86460cd8167d1 100644
> --- a/drivers/gpu/drm/i915/i915_driver.c
> +++ b/drivers/gpu/drm/i915/i915_driver.c
> @@ -924,27 +924,6 @@ static int i915_driver_open(struct drm_device
> *dev, struct drm_file *file)
> return 0;
> }
>
> -/**
> - * i915_driver_lastclose - clean up after all DRM clients have
> exited
> - * @dev: DRM device
> - *
> - * Take care of cleaning up after all DRM clients have exited. In
> the
> - * mode setting case, we want to restore the kernel's initial mode
> (just
> - * in case the last client left us in a bad state).
> - *
> - * Additionally, in the non-mode setting case, we'll tear down the
> GTT
> - * and DMA structures, since the kernel won't be using them, and
> clea
> - * up any GEM state.
> - */
> -static void i915_driver_lastclose(struct drm_device *dev)
> -{
> - struct drm_i915_private *i915 = to_i915(dev);
> -
> - intel_fbdev_restore_mode(i915);
> -
> - vga_switcheroo_process_delayed_switch();
> -}
> -
> static void i915_driver_postclose(struct drm_device *dev, struct
> drm_file *file)
> {
> struct drm_i915_file_private *file_priv = file->driver_priv;
> @@ -1822,7 +1801,6 @@ static const struct drm_driver i915_drm_driver
> = {
> DRIVER_SYNCOBJ_TIMELINE,
> .release = i915_driver_release,
> .open = i915_driver_open,
> - .lastclose = i915_driver_lastclose,
> .postclose = i915_driver_postclose,
> .show_fdinfo = PTR_IF(IS_ENABLED(CONFIG_PROC_FS),
> i915_drm_client_fdinfo),
>
next prev parent reply other threads:[~2023-10-25 9:36 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-27 10:26 [Intel-gfx] [PATCH v5 0/7] drm/i915: Convert fbdev to DRM client Thomas Zimmermann
2023-09-27 10:26 ` Thomas Zimmermann
2023-09-27 10:26 ` [Intel-gfx] [PATCH v5 1/7] drm/i915: Unregister in-kernel clients Thomas Zimmermann
2023-09-27 10:26 ` Thomas Zimmermann
2023-10-25 7:28 ` [Intel-gfx] " Hogander, Jouni
2023-09-27 10:26 ` [Intel-gfx] [PATCH v5 2/7] drm/client: Do not acquire module reference Thomas Zimmermann
2023-09-27 10:26 ` Thomas Zimmermann
2023-11-01 12:01 ` [Intel-gfx] " Javier Martinez Canillas
2023-11-01 12:01 ` Javier Martinez Canillas
2023-09-27 10:26 ` [Intel-gfx] [PATCH v5 3/7] drm/client: Export drm_client_dev_unregister() Thomas Zimmermann
2023-09-27 10:26 ` Thomas Zimmermann
2023-09-27 10:26 ` [Intel-gfx] [PATCH v5 4/7] drm/i915: Move fbdev functions Thomas Zimmermann
2023-09-27 10:26 ` Thomas Zimmermann
2023-10-25 7:49 ` [Intel-gfx] " Hogander, Jouni
2023-10-25 7:49 ` Hogander, Jouni
2023-09-27 10:26 ` [Intel-gfx] [PATCH v5 5/7] drm/i915: Initialize fbdev DRM client with callback functions Thomas Zimmermann
2023-09-27 10:26 ` Thomas Zimmermann
2023-10-25 8:36 ` [Intel-gfx] " Hogander, Jouni
2023-11-01 8:11 ` Thomas Zimmermann
2023-11-01 9:10 ` Hogander, Jouni
2023-11-01 9:32 ` Thomas Zimmermann
2023-09-27 10:26 ` [Intel-gfx] [PATCH v5 6/7] drm/i915: Implement fbdev client callbacks Thomas Zimmermann
2023-09-27 10:26 ` Thomas Zimmermann
2023-10-25 9:36 ` Hogander, Jouni [this message]
2023-11-01 8:26 ` [Intel-gfx] " Thomas Zimmermann
2023-09-27 10:26 ` [Intel-gfx] [PATCH v5 7/7] drm/i915: Implement fbdev emulation as in-kernel client Thomas Zimmermann
2023-09-27 10:26 ` Thomas Zimmermann
2023-10-25 11:36 ` [Intel-gfx] " Hogander, Jouni
2023-10-25 11:36 ` Hogander, Jouni
2023-11-01 8:33 ` [Intel-gfx] " Thomas Zimmermann
2023-11-01 8:33 ` Thomas Zimmermann
2023-11-01 9:25 ` [Intel-gfx] " Ville Syrjälä
2023-11-01 9:25 ` Ville Syrjälä
2023-11-01 9:35 ` [Intel-gfx] " Thomas Zimmermann
2023-11-01 9:35 ` Thomas Zimmermann
2023-09-27 18:52 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: Convert fbdev to DRM client (rev5) Patchwork
2023-09-27 19:06 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-09-28 7:32 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
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=07431faca53e93e502006484c362ce08d36a6335.camel@intel.com \
--to=jouni.hogander@intel.com \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=javierm@redhat.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=tejas.upadhyay@intel.com \
--cc=tvrtko.ursulin@linux.intel.com \
--cc=tzimmermann@suse.de \
--cc=ville.syrjala@linux.intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.