vmwgfx: allow building with CONFIG_HAS_IOPORT disabled
Subsystems (3)
PATCH 1/1 vmwgfx: allow building with CONFIG_HAS_IOPORT disabled
From: Arnd Bergmann <[email protected]>
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 _outlinclude/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.
--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 ++ drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +2 -0
@@ -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 ) }, { } };
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +4 -1
@@ -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 ; }
Signature · 1 line
2.39.2
Quoted 58 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
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,
fromdrivers/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()requiresCONFIG_HAS_IOPORT
626 | #define_outl_outlinclude/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 <[email protected]>--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 ++ drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-)drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +2
-0@@ -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 ) }, { } };drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +4
-2@@ -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 ; } --
Quoted 2 lines
2.39.2
Thanks! Looks good. Would you like me to push this through drm-misc-fixes?
z