Re: [Nouveau] [Intel-gfx] [PATCH v2 2/3] drm/fb-helper: Set framebuffer for vga-switcheroo clients
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 > Reviewed-by: Daniel Vetter > Reviewed-by: Alex Deucher > Cc: Ben Skeggs > Cc: Karol Herbst > Cc: Lyude Paul > Cc: Thomas Zimmermann > Cc: Javier Martinez Canillas > Cc: Laurent Pinchart > Cc: Jani Nikula > Cc: Dave Airlie > Cc: Evan Quan > Cc: Christian König > Cc: Alex Deucher > Cc: Hawking Zhang > Cc: Likun Gao > Cc: "Christian König" > Cc: Stanley Yang > Cc: "Tianci.Yin" > Cc: Xiaojian Du > Cc: Andrey Grodzovsky > Cc: YiPeng Chai > Cc: Somalapuram Amaranath > Cc: Bokun Zhang > Cc: Guchun Chen > Cc: Hamza Mahfooz > Cc: Aurabindo Pillai > Cc: Mario Limonciello > Cc: Solomon Chiu > Cc: Kai-Heng Feng > Cc: Felix Kuehling > Cc: Daniel Vetter > Cc: "Marek Olšák" > Cc: Sam Ravnborg > Cc: Hans de Goede > Cc: "Ville Syrjälä" > Cc: dri-de...@lists.freedesktop.org > Cc: nouveau@lists.freedesktop.org > Cc: # 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 > +#include > #include > +#include > > #include > #include > @@ -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 = _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 >
Re: [Nouveau] [Intel-gfx] [PATCH v2 2/3] drm/fb-helper: Set framebuffer for vga-switcheroo clients
Hi Am 18.01.23 um 20:21 schrieb Rodrigo Vivi: 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 Reviewed-by: Daniel Vetter Reviewed-by: Alex Deucher Cc: Ben Skeggs Cc: Karol Herbst Cc: Lyude Paul Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Cc: Laurent Pinchart Cc: Jani Nikula Cc: Dave Airlie Cc: Evan Quan Cc: Christian König Cc: Alex Deucher Cc: Hawking Zhang Cc: Likun Gao Cc: "Christian König" Cc: Stanley Yang Cc: "Tianci.Yin" Cc: Xiaojian Du Cc: Andrey Grodzovsky Cc: YiPeng Chai Cc: Somalapuram Amaranath Cc: Bokun Zhang Cc: Guchun Chen Cc: Hamza Mahfooz Cc: Aurabindo Pillai Cc: Mario Limonciello Cc: Solomon Chiu Cc: Kai-Heng Feng Cc: Felix Kuehling Cc: Daniel Vetter Cc: "Marek Olšák" Cc: Sam Ravnborg Cc: Hans de Goede Cc: "Ville Syrjälä" Cc: dri-de...@lists.freedesktop.org Cc: nouveau@lists.freedesktop.org Cc: # 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 +#include #include +#include #include #include @@ -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 = _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. Thank you. Is it fixed for now? We probably need a backmerge from drm-next into drm-misc-fixes with the resolution applied there. And probably propagated that resolution later... Backmerging from -next into -fixes branches is a problem, as -fixes should be close to the latest release. Can we solve this by merging -fixes into upstream and backmerging this into our -next branches? Best regards Thomas 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 -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Ivo Totev OpenPGP_signature Description: OpenPGP digital signature
Re: [Nouveau] [Intel-gfx] [PATCH v2 2/3] drm/fb-helper: Set framebuffer for vga-switcheroo clients
On Thu, Jan 19, 2023 at 09:06:54AM +0100, Thomas Zimmermann wrote: > Hi > > Am 18.01.23 um 20:21 schrieb Rodrigo Vivi: > > 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 > > > Reviewed-by: Daniel Vetter > > > Reviewed-by: Alex Deucher > > > Cc: Ben Skeggs > > > Cc: Karol Herbst > > > Cc: Lyude Paul > > > Cc: Thomas Zimmermann > > > Cc: Javier Martinez Canillas > > > Cc: Laurent Pinchart > > > Cc: Jani Nikula > > > Cc: Dave Airlie > > > Cc: Evan Quan > > > Cc: Christian König > > > Cc: Alex Deucher > > > Cc: Hawking Zhang > > > Cc: Likun Gao > > > Cc: "Christian König" > > > Cc: Stanley Yang > > > Cc: "Tianci.Yin" > > > Cc: Xiaojian Du > > > Cc: Andrey Grodzovsky > > > Cc: YiPeng Chai > > > Cc: Somalapuram Amaranath > > > Cc: Bokun Zhang > > > Cc: Guchun Chen > > > Cc: Hamza Mahfooz > > > Cc: Aurabindo Pillai > > > Cc: Mario Limonciello > > > Cc: Solomon Chiu > > > Cc: Kai-Heng Feng > > > Cc: Felix Kuehling > > > Cc: Daniel Vetter > > > Cc: "Marek Olšák" > > > Cc: Sam Ravnborg > > > Cc: Hans de Goede > > > Cc: "Ville Syrjälä" > > > Cc: dri-de...@lists.freedesktop.org > > > Cc: nouveau@lists.freedesktop.org > > > Cc: # 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 > > > +#include > > > #include > > > +#include > > > #include > > > #include > > > @@ -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 = _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. > > Thank you. Is it fixed for now? Fixed in drm-tip, yes. But broke linux-next as well. This resolution will need to go up with any merge... > > > > > We probably need a backmerge from drm-next into drm-misc-fixes with > > the resolution applied there. And probably propagated that resolution > > later... > > Backmerging from -next into -fixes branches is a problem, as -fixes should > be close to the latest release. doh! Indeed I should've known this by heart... -ENOTEHOUGHCOFFEE > > Can we solve this by merging -fixes into upstream and backmerging this into > our -next branches? hmmm... probably better just wait and let folks know the resolution when the patches are moving up... > > Best regards > Thomas > > > > > > 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 > > > > > -- > Thomas Zimmermann > Graphics Driver Developer > SUSE Software Solutions Germany GmbH > Maxfeldstr. 5, 90409 Nürnberg, Germany > (HRB 36809, AG Nürnberg) > Geschäftsführer: Ivo Totev