On Thu, Jan 12, 2023 at 09:11:55PM +0100, Thomas Zimmermann wrote:
> Set the framebuffer info for drivers that support VGA switcheroo. Only
> affects the amdgpu and nouveau drivers, which use VGA switcheroo and
> generic fbdev emulation. For other drivers, this does nothing.
> 
> This fixes a potential regression in the console code. Both, amdgpu and
> nouveau, invoked vga_switcheroo_client_fb_set() from their internal fbdev
> code. But the call got lost when the drivers switched to the generic
> emulation.
> 
> Fixes: 087451f372bf ("drm/amdgpu: use generic fb helpers instead of setting 
> up AMD own's.")
> Fixes: 4a16dd9d18a0 ("drm/nouveau/kms: switch to drm fbdev helpers")
> Signed-off-by: Thomas Zimmermann <tzimmerm...@suse.de>
> Reviewed-by: Daniel Vetter <daniel.vet...@ffwll.ch>
> Reviewed-by: Alex Deucher <alexander.deuc...@amd.com>
> Cc: Ben Skeggs <bske...@redhat.com>
> Cc: Karol Herbst <kher...@redhat.com>
> Cc: Lyude Paul <ly...@redhat.com>
> Cc: Thomas Zimmermann <tzimmerm...@suse.de>
> Cc: Javier Martinez Canillas <javi...@redhat.com>
> Cc: Laurent Pinchart <laurent.pinch...@ideasonboard.com>
> Cc: Jani Nikula <jani.nik...@intel.com>
> Cc: Dave Airlie <airl...@redhat.com>
> Cc: Evan Quan <evan.q...@amd.com>
> Cc: Christian König <christian.koe...@amd.com>
> Cc: Alex Deucher <alexander.deuc...@amd.com>
> Cc: Hawking Zhang <hawking.zh...@amd.com>
> Cc: Likun Gao <likun....@amd.com>
> Cc: "Christian König" <christian.koe...@amd.com>
> Cc: Stanley Yang <stanley.y...@amd.com>
> Cc: "Tianci.Yin" <tianci....@amd.com>
> Cc: Xiaojian Du <xiaojian...@amd.com>
> Cc: Andrey Grodzovsky <andrey.grodzov...@amd.com>
> Cc: YiPeng Chai <yipeng.c...@amd.com>
> Cc: Somalapuram Amaranath <amaranath.somalapu...@amd.com>
> Cc: Bokun Zhang <bokun.zh...@amd.com>
> Cc: Guchun Chen <guchun.c...@amd.com>
> Cc: Hamza Mahfooz <hamza.mahf...@amd.com>
> Cc: Aurabindo Pillai <aurabindo.pil...@amd.com>
> Cc: Mario Limonciello <mario.limoncie...@amd.com>
> Cc: Solomon Chiu <solomon.c...@amd.com>
> Cc: Kai-Heng Feng <kai.heng.f...@canonical.com>
> Cc: Felix Kuehling <felix.kuehl...@amd.com>
> Cc: Daniel Vetter <daniel.vet...@ffwll.ch>
> Cc: "Marek Olšák" <marek.ol...@amd.com>
> Cc: Sam Ravnborg <s...@ravnborg.org>
> Cc: Hans de Goede <hdego...@redhat.com>
> Cc: "Ville Syrjälä" <ville.syrj...@linux.intel.com>
> Cc: dri-de...@lists.freedesktop.org
> Cc: nouveau@lists.freedesktop.org
> Cc: <sta...@vger.kernel.org> # v5.17+
> ---
>  drivers/gpu/drm/drm_fb_helper.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index 427631706128..5e445c61252d 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -30,7 +30,9 @@
>  #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>  
>  #include <linux/console.h>
> +#include <linux/pci.h>
>  #include <linux/sysrq.h>
> +#include <linux/vga_switcheroo.h>
>  
>  #include <drm/drm_atomic.h>
>  #include <drm/drm_drv.h>
> @@ -1940,6 +1942,7 @@ static int drm_fb_helper_single_fb_probe(struct 
> drm_fb_helper *fb_helper,
>                                        int preferred_bpp)
>  {
>       struct drm_client_dev *client = &fb_helper->client;
> +     struct drm_device *dev = fb_helper->dev;

On drm-tip, this commit has a silent conflict with
cff84bac9922 ("drm/fh-helper: Split fbdev single-probe helper")
that's already in drm-next.

I had created a fix-up patch in drm-tip re-introducing this line.

We probably need a backmerge from drm-next into drm-misc-fixes with
the resolution applied there. And probably propagated that resolution
later...

>       struct drm_fb_helper_surface_size sizes;
>       int ret;
>  
> @@ -1961,6 +1964,11 @@ static int drm_fb_helper_single_fb_probe(struct 
> drm_fb_helper *fb_helper,
>               return ret;
>  
>       strcpy(fb_helper->fb->comm, "[fbcon]");
> +
> +     /* Set the fb info for vgaswitcheroo clients. Does nothing otherwise. */
> +     if (dev_is_pci(dev->dev))
> +             vga_switcheroo_client_fb_set(to_pci_dev(dev->dev), 
> fb_helper->info);
> +
>       return 0;
>  }
>  
> -- 
> 2.39.0
> 

Reply via email to