On Mon, Nov 10, 2025 at 11:33 AM Ian Forbes <[email protected]> wrote:
>
> 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.
>
> Signed-off-by: Ian Forbes <[email protected]>
> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h 
> b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
> index 3fde6dfe64e4..f7c760d72b85 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
> @@ -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

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to