Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: dri-devel@lists.freedesktop.org, kherbst@redhat.com,
	amd-gfx@lists.freedesktop.org, nouveau@lists.freedesktop.org,
	intel-gfx@lists.freedesktop.org, Xinhui.Pan@amd.com,
	mripard@kernel.org, Daniel Vetter <daniel.vetter@ffwll.ch>,
	daniel@ffwll.ch, rodrigo.vivi@intel.com,
	alexander.deucher@amd.com, evan.quan@amd.com, airlied@gmail.com,
	christian.koenig@amd.com, bskeggs@redhat.com
Subject: Re: [Intel-gfx] [PATCH v2 3/3] drm: Call vga_switcheroo_process_delayed_switch() in drm_lastclose
Date: Tue, 17 Jan 2023 10:44:40 +0100	[thread overview]
Message-ID: <20230117094440.GA30914@wunner.de> (raw)
In-Reply-To: <20230112201156.26849-4-tzimmermann@suse.de>

On Thu, Jan 12, 2023 at 09:11:56PM +0100, Thomas Zimmermann wrote:
> Several lastclose helpers call vga_switcheroo_process_delayed_switch().
> It's better to call the helper from drm_lastclose() after the kernel
> client's screen has been restored. This way, all drivers can benefit
> without having to implement their own lastclose helper. For drivers
> without vga-switcheroo, vga_switcheroo_process_delayed_switch() does
> nothing.
[...]
> --- a/drivers/gpu/drm/drm_file.c
> +++ b/drivers/gpu/drm/drm_file.c
> @@ -38,6 +38,7 @@
>  #include <linux/pci.h>
>  #include <linux/poll.h>
>  #include <linux/slab.h>
> +#include <linux/vga_switcheroo.h>
>  
>  #include <drm/drm_client.h>
>  #include <drm/drm_drv.h>
> @@ -460,6 +461,8 @@ void drm_lastclose(struct drm_device * dev)
>  		drm_legacy_dev_reinit(dev);
>  
>  	drm_client_dev_restore(dev);
> +
> +	vga_switcheroo_process_delayed_switch();
>  }

Hm, this looks like a case of midlayer fallacy:

https://blog.ffwll.ch/2016/12/midlayers-once-more-with-feeling.html

It is a departure from the opt-in library approach we've had so far.

For switcheroo-aware EDID retrieval, there's a drm_get_edid_switcheroo()
helper.  How about introducing a switcheroo-aware lastclose helper which
drivers can reference?

Thanks,

Lukas

  reply	other threads:[~2023-01-17  9:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-12 20:11 [Intel-gfx] [PATCH v2 0/3] drm: Generic fbdev and vga-switcheroo Thomas Zimmermann
2023-01-12 20:11 ` [Intel-gfx] [PATCH v2 1/3] drm/i915: Allow switching away via vga-switcheroo if uninitialized Thomas Zimmermann
2023-01-12 20:11 ` [Intel-gfx] [PATCH v2 2/3] drm/fb-helper: Set framebuffer for vga-switcheroo clients Thomas Zimmermann
2023-01-18 19:21   ` Rodrigo Vivi
2023-01-19  8:06     ` Thomas Zimmermann
2023-01-19 22:10       ` Rodrigo Vivi
2023-01-12 20:11 ` [Intel-gfx] [PATCH v2 3/3] drm: Call vga_switcheroo_process_delayed_switch() in drm_lastclose Thomas Zimmermann
2023-01-17  9:44   ` Lukas Wunner [this message]
2023-01-17 10:36     ` Thomas Zimmermann
2023-01-30 22:45   ` Lyude Paul
2023-01-12 20:47 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm: Generic fbdev and vga-switcheroo Patchwork
2023-01-12 21:10 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-01-13 11:03 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=20230117094440.GA30914@wunner.de \
    --to=lukas@wunner.de \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=bskeggs@redhat.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=evan.quan@amd.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=kherbst@redhat.com \
    --cc=mripard@kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.com \
    --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