[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241004205053.1068629-1-arnd@kernel.org>
Date: Fri, 4 Oct 2024 20:50:34 +0000
From: Arnd Bergmann <arnd@...nel.org>
To: Zack Rusin <zack.rusin@...adcom.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>
Cc: Niklas Schnelle <schnelle@...ux.ibm.com>,
Arnd Bergmann <arnd@...db.de>,
Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>,
Martin Krastev <martin.krastev@...adcom.com>,
Javier Martinez Canillas <javierm@...hat.com>,
Ian Forbes <ian.forbes@...adcom.com>,
dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] vmwgfx: allow building with CONFIG_HAS_IOPORT disabled
From: Arnd Bergmann <arnd@...db.de>
The older version of the vmwgfx driver requires port I/O in order to work:
In file included from arch/arm64/include/asm/io.h:298,
from drivers/gpu/drm/vmwgfx/vmwgfx_kms.c:28:
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h: In function 'vmw_read':
include/asm-generic/io.h:626:15: error: call to '_outl' declared with attribute error: outl() requires CONFIG_HAS_IOPORT
626 | #define _outl _outl
include/asm-generic/io.h:663:14: note: in expansion of macro '_outl'
663 | #define outl _outl
| ^~~~~
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h:692:17: note: in expansion of macro 'outl'
692 | outl(offset, dev_priv->io_start + SVGA_INDEX_PORT);
| ^~~~
Change the version check to hardcode the v3 version and remove the PCI
ID for v2 in configurations that only support v3.
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 ++
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 5 ++++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index 2825dd3149ed..dfb4b2ba23c6 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -262,7 +262,9 @@ static const struct drm_ioctl_desc vmw_ioctls[] = {
};
static const struct pci_device_id vmw_pci_id_list[] = {
+#ifdef CONFIG_HAS_IOPORT
{ PCI_DEVICE(PCI_VENDOR_ID_VMWARE, VMWGFX_PCI_ID_SVGA2) },
+#endif
{ PCI_DEVICE(PCI_VENDOR_ID_VMWARE, VMWGFX_PCI_ID_SVGA3) },
{ }
};
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
index 3f4719b3c268..a2fda4d43b4e 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
@@ -655,8 +655,11 @@ static inline struct vmw_fpriv *vmw_fpriv(struct drm_file *file_priv)
/*
* SVGA v3 has mmio register access and lacks fifo cmds
*/
-static inline bool vmw_is_svga_v3(const struct vmw_private *dev)
+static __always_inline bool vmw_is_svga_v3(const struct vmw_private *dev)
{
+ if (!IS_ENABLED(CONFIG_HAS_IOPORT))
+ return true;
+
return dev->pci_id == VMWGFX_PCI_ID_SVGA3;
}
--
2.39.2
Powered by blists - more mailing lists