Skip to contentSkip to conversation

drm/vmwgfx: SVGA3 is the only option on ARM64

PATCH In review Ian Forbes 2 participants 2 messages Nov 10, 2025 – Nov 12, 2025

Subsystems (3)
lore
Share & tools
lore

Ian Forbes

author
#0 lore raw

PATCH 1/1 drm/vmwgfx: SVGA3 is the only option on ARM64

SVGA3 is the only vmwgfx device available on ARM64. This change allows vmw_read and vmw_write to be completely eliminated by the compiler on ARM64 reducing the final module size by 128 KiB.

---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +4 -0
index 3fde6dfe64e4..f7c760d72b85 100644
@@ -630,7 +630,11 @@ static inline struct vmw_fpriv *vmw_fpriv(struct drm_file *file_priv)
  */
 static inline bool vmw_is_svga_v3(const struct vmw_private *dev)
 {
+#if defined(CONFIG_ARM64)
+	return true;
+#else
 	return dev->pci_id == VMWGFX_PCI_ID_SVGA3;
+#endif
 }
 
 /*
Signature · 1 line
2.51.1
maintainer
#1 lore raw
Quoted 15 lines · Ian Forbes

SVGA3 is the only vmwgfx device available on ARM64. This change allows vmw_read and vmw_write to be completely eliminated by the compiler on ARM64 reducing the final module size by 128 KiB.

---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +0 -0
index 3fde6dfe64e4..f7c760d72b85 100644

drivers/gpu/drm/vmwgfx/vmwgfx_drv.h static inline struct vmw_fpriv *vmw_fpriv(struct drm_file *file_priv) · line 639

Quoted 10 lines
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +4 -0
@@ -630,7 +630,11 @@ static inline struct vmw_fpriv *vmw_fpriv(struct drm_file *file_priv)
  */
 static inline bool vmw_is_svga_v3(const struct vmw_private *dev)
 {
+#if defined(CONFIG_ARM64)
+       return true;
+#else
        return dev->pci_id == VMWGFX_PCI_ID_SVGA3;
+#endif
 }
 

That's a great idea. We also don't really support SVGA3 on x86/x64 so we should be able to just return false on those paths there. The only thing that'd be great is if you could just add a check to the driver init that verifies that if we're on arm64 our pci id is svga3 and if we're on x86/x64 our pci id == svga2 and then vmw_is_svga_v3 should mention the check in the driver init and the driver init should mention that if it's modified vmw_is_svga_v3 will have to modified as well.

z