From: Thomas Zimmermann <tzimmermann@suse.de>
To: alexander.deucher@amd.com, christian.koenig@amd.com,
airlied@linux.ie, daniel@ffwll.ch,
maarten.lankhorst@linux.intel.com, mripard@kernel.org
Cc: Thomas Zimmermann <tzimmermann@suse.de>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [PATCH 1/7] drm/fb-helper: Set framebuffer for vga-switcheroo clients
Date: Thu, 12 Nov 2020 14:21:11 +0100 [thread overview]
Message-ID: <20201112132117.27228-2-tzimmermann@suse.de> (raw)
In-Reply-To: <20201112132117.27228-1-tzimmermann@suse.de>
Set the framebuffer info for devices that support vga switcheroo. For
other devices, this does nothing.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
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 01ba1da28511..d2ba404a23b3 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -33,8 +33,10 @@
#include <linux/dma-buf.h>
#include <linux/kernel.h>
#include <linux/module.h>
+#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/sysrq.h>
+#include <linux/vga_switcheroo.h>
#include <linux/vmalloc.h>
#include <drm/drm_atomic.h>
@@ -1940,6 +1942,8 @@ EXPORT_SYMBOL(drm_fb_helper_hotplug_event);
void drm_fb_helper_lastclose(struct drm_device *dev)
{
drm_fb_helper_restore_fbdev_mode_unlocked(dev->fb_helper);
+
+ vga_switcheroo_process_delayed_switch();
}
EXPORT_SYMBOL(drm_fb_helper_lastclose);
@@ -2311,6 +2315,10 @@ static int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper,
#endif
}
+ /* 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), fbi);
+
return 0;
}
--
2.29.2
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
WARNING: multiple messages have this Message-ID (diff)
From: Thomas Zimmermann <tzimmermann@suse.de>
To: alexander.deucher@amd.com, christian.koenig@amd.com,
airlied@linux.ie, daniel@ffwll.ch,
maarten.lankhorst@linux.intel.com, mripard@kernel.org
Cc: Thomas Zimmermann <tzimmermann@suse.de>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [PATCH 1/7] drm/fb-helper: Set framebuffer for vga-switcheroo clients
Date: Thu, 12 Nov 2020 14:21:11 +0100 [thread overview]
Message-ID: <20201112132117.27228-2-tzimmermann@suse.de> (raw)
In-Reply-To: <20201112132117.27228-1-tzimmermann@suse.de>
Set the framebuffer info for devices that support vga switcheroo. For
other devices, this does nothing.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
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 01ba1da28511..d2ba404a23b3 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -33,8 +33,10 @@
#include <linux/dma-buf.h>
#include <linux/kernel.h>
#include <linux/module.h>
+#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/sysrq.h>
+#include <linux/vga_switcheroo.h>
#include <linux/vmalloc.h>
#include <drm/drm_atomic.h>
@@ -1940,6 +1942,8 @@ EXPORT_SYMBOL(drm_fb_helper_hotplug_event);
void drm_fb_helper_lastclose(struct drm_device *dev)
{
drm_fb_helper_restore_fbdev_mode_unlocked(dev->fb_helper);
+
+ vga_switcheroo_process_delayed_switch();
}
EXPORT_SYMBOL(drm_fb_helper_lastclose);
@@ -2311,6 +2315,10 @@ static int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper,
#endif
}
+ /* 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), fbi);
+
return 0;
}
--
2.29.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-11-12 13:21 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-12 13:21 [PATCH 0/7] drm/radeon: Convert to generic fbdev emulation Thomas Zimmermann
2020-11-12 13:21 ` Thomas Zimmermann
2020-11-12 13:21 ` Thomas Zimmermann [this message]
2020-11-12 13:21 ` [PATCH 1/7] drm/fb-helper: Set framebuffer for vga-switcheroo clients Thomas Zimmermann
2020-11-12 13:21 ` [PATCH 2/7] drm/fb-helper: Add hint to enable VT switching during suspend/resume Thomas Zimmermann
2020-11-12 13:21 ` Thomas Zimmermann
2020-11-12 13:21 ` [PATCH 3/7] drm/radeon: Whitespace fixes Thomas Zimmermann
2020-11-12 13:21 ` Thomas Zimmermann
2020-11-12 13:21 ` [PATCH 4/7] drm/radeon: Pin buffers while they are vmap'ed Thomas Zimmermann
2020-11-12 13:21 ` Thomas Zimmermann
2020-11-12 17:16 ` Christian König
2020-11-12 17:16 ` Christian König
2020-11-13 7:59 ` Thomas Zimmermann
2020-11-13 7:59 ` Thomas Zimmermann
2020-11-16 11:28 ` Christian König
2020-11-16 11:28 ` Christian König
2020-11-13 16:27 ` Thomas Zimmermann
2020-11-13 16:27 ` Thomas Zimmermann
2020-11-16 20:07 ` Thomas Zimmermann
2020-11-16 20:07 ` Thomas Zimmermann
2020-11-24 9:16 ` Thomas Zimmermann
2020-11-24 9:16 ` Thomas Zimmermann
2020-11-24 11:30 ` Christian König
2020-11-24 11:30 ` Christian König
2020-11-24 11:44 ` Thomas Zimmermann
2020-11-24 11:44 ` Thomas Zimmermann
2020-11-24 11:54 ` Christian König
2020-11-24 11:54 ` Christian König
2020-11-24 12:15 ` Thomas Zimmermann
2020-11-24 12:15 ` Thomas Zimmermann
2020-11-24 13:36 ` Christian König
2020-11-24 13:36 ` Christian König
2020-11-24 13:56 ` Thomas Zimmermann
2020-11-24 13:56 ` Thomas Zimmermann
2020-11-24 14:06 ` Christian König
2020-11-24 14:06 ` Christian König
2020-11-25 8:28 ` Thomas Zimmermann
2020-11-25 8:28 ` Thomas Zimmermann
2020-11-24 14:09 ` Daniel Vetter
2020-11-24 14:09 ` Daniel Vetter
2020-11-25 8:37 ` Thomas Zimmermann
2020-11-25 8:37 ` Thomas Zimmermann
2020-11-25 10:13 ` Christian König
2020-11-25 10:13 ` Christian König
2020-11-25 10:36 ` Daniel Vetter
2020-11-25 10:36 ` Daniel Vetter
2020-11-25 10:57 ` Christian König
2020-11-25 10:57 ` Christian König
2020-11-25 11:38 ` Thomas Zimmermann
2020-11-25 11:38 ` Thomas Zimmermann
2020-11-25 16:32 ` Daniel Vetter
2020-11-25 16:32 ` Daniel Vetter
2020-11-26 10:15 ` Thomas Zimmermann
2020-11-26 10:15 ` Thomas Zimmermann
2020-11-26 11:04 ` Daniel Vetter
2020-11-26 11:04 ` Daniel Vetter
2020-11-26 11:28 ` Christian König
2020-11-26 11:28 ` Christian König
2020-11-26 11:42 ` Thomas Zimmermann
2020-11-26 11:42 ` Thomas Zimmermann
2020-11-26 11:59 ` Thomas Zimmermann
2020-11-26 11:59 ` Thomas Zimmermann
2020-11-26 12:08 ` Christian König
2020-11-26 12:08 ` Christian König
2020-11-26 12:14 ` Thomas Zimmermann
2020-11-26 12:14 ` Thomas Zimmermann
2020-11-26 12:16 ` Christian König
2020-11-26 12:16 ` Christian König
2020-11-12 13:21 ` [PATCH 5/7] drm/radeon: Replace framebuffer console with generic implementation Thomas Zimmermann
2020-11-12 13:21 ` Thomas Zimmermann
2020-11-12 13:21 ` [PATCH 6/7] drm/radeon: Use fbdev shadow fb Thomas Zimmermann
2020-11-12 13:21 ` Thomas Zimmermann
2020-11-12 13:21 ` [PATCH 7/7] drm/radeon: Move radeon_align_pitch() next to its only caller Thomas Zimmermann
2020-11-12 13:21 ` Thomas Zimmermann
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=20201112132117.27228-2-tzimmermann@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
/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.