Thomas Zimmermann fdc716
From 50ca8cc7c0fdd9ab16b8b66ffb301fface101fac Mon Sep 17 00:00:00 2001
Thomas Zimmermann fdc716
From: Zack Rusin <zackr@vmware.com>
Thomas Zimmermann fdc716
Date: Wed, 15 Dec 2021 13:41:47 -0500
Thomas Zimmermann fdc716
Subject: drm/vmwgfx: Remove unused compile options
Thomas Zimmermann fdc716
Git-commit: 50ca8cc7c0fdd9ab16b8b66ffb301fface101fac
Thomas Zimmermann fdc716
Patch-mainline: v5.17-rc1
Thomas Zimmermann fdc716
References: bsc#1152472
Thomas Zimmermann fdc716
Thomas Zimmermann fdc716
Before the driver had screen targets support we had to disable explicit
Thomas Zimmermann fdc716
bringup of its infrastructure because it was breaking screen objects
Thomas Zimmermann fdc716
support.
Thomas Zimmermann fdc716
Since the implementation of screen targets landed there hasn't been a
Thomas Zimmermann fdc716
reason to explicitly disable it and the options were never used.
Thomas Zimmermann fdc716
Remove of all that unused code.
Thomas Zimmermann fdc716
Thomas Zimmermann fdc716
Signed-off-by: Zack Rusin <zackr@vmware.com>
Thomas Zimmermann fdc716
Fixes: d80efd5cb3de ("drm/vmwgfx: Initial DX support")
Thomas Zimmermann fdc716
Reviewed-by: Martin Krastev <krastevm@vmware.com>
Thomas Zimmermann fdc716
Link: https://patchwork.freedesktop.org/patch/msgid/20211215184147.3688785-3-zack@kde.org
Thomas Zimmermann fdc716
(cherry picked from commit 11343099d5ae6c7411da1425b6b162c89fb5bf10)
Thomas Zimmermann fdc716
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Thomas Zimmermann fdc716
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Thomas Zimmermann fdc716
---
Thomas Zimmermann fdc716
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.h  |    3 ---
Thomas Zimmermann fdc716
 drivers/gpu/drm/vmwgfx/vmwgfx_mob.c  |   12 +++---------
Thomas Zimmermann fdc716
 drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c |    4 ++--
Thomas Zimmermann fdc716
 3 files changed, 5 insertions(+), 14 deletions(-)
Thomas Zimmermann fdc716
Thomas Zimmermann fdc716
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
Thomas Zimmermann fdc716
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
Thomas Zimmermann fdc716
@@ -61,11 +61,8 @@
Thomas Zimmermann fdc716
 #define VMWGFX_DRIVER_MINOR 18
Thomas Zimmermann fdc716
 #define VMWGFX_DRIVER_PATCHLEVEL 0
Thomas Zimmermann fdc716
 #define VMWGFX_FIFO_STATIC_SIZE (1024*1024)
Thomas Zimmermann fdc716
-#define VMWGFX_MAX_RELOCATIONS 2048
Thomas Zimmermann fdc716
-#define VMWGFX_MAX_VALIDATIONS 2048
Thomas Zimmermann fdc716
 #define VMWGFX_MAX_DISPLAYS 16
Thomas Zimmermann fdc716
 #define VMWGFX_CMD_BOUNCE_INIT_SIZE 32768
Thomas Zimmermann fdc716
-#define VMWGFX_ENABLE_SCREEN_TARGET_OTABLE 1
Thomas Zimmermann fdc716
 
Thomas Zimmermann fdc716
 /*
Thomas Zimmermann fdc716
  * Perhaps we should have sysfs entries for these.
Thomas Zimmermann fdc716
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c
Thomas Zimmermann fdc716
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c
Thomas Zimmermann fdc716
@@ -1,7 +1,7 @@
Thomas Zimmermann fdc716
 // SPDX-License-Identifier: GPL-2.0 OR MIT
Thomas Zimmermann fdc716
 /**************************************************************************
Thomas Zimmermann fdc716
  *
Thomas Zimmermann fdc716
- * Copyright 2012-2015 VMware, Inc., Palo Alto, CA., USA
Thomas Zimmermann fdc716
+ * Copyright 2012-2021 VMware, Inc., Palo Alto, CA., USA
Thomas Zimmermann fdc716
  *
Thomas Zimmermann fdc716
  * Permission is hereby granted, free of charge, to any person obtaining a
Thomas Zimmermann fdc716
  * copy of this software and associated documentation files (the
Thomas Zimmermann fdc716
@@ -29,12 +29,6 @@
Thomas Zimmermann fdc716
 
Thomas Zimmermann fdc716
 #include "vmwgfx_drv.h"
Thomas Zimmermann fdc716
 
Thomas Zimmermann fdc716
-/*
Thomas Zimmermann fdc716
- * If we set up the screen target otable, screen objects stop working.
Thomas Zimmermann fdc716
- */
Thomas Zimmermann fdc716
-
Thomas Zimmermann fdc716
-#define VMW_OTABLE_SETUP_SUB ((VMWGFX_ENABLE_SCREEN_TARGET_OTABLE ? 0 : 1))
Thomas Zimmermann fdc716
-
Thomas Zimmermann fdc716
 #ifdef CONFIG_64BIT
Thomas Zimmermann fdc716
 #define VMW_PPN_SIZE 8
Thomas Zimmermann fdc716
 #define VMW_MOBFMT_PTDEPTH_0 SVGA3D_MOBFMT_PTDEPTH64_0
Thomas Zimmermann fdc716
@@ -75,7 +69,7 @@ static const struct vmw_otable pre_dx_ta
Thomas Zimmermann fdc716
 	{VMWGFX_NUM_GB_CONTEXT * SVGA3D_OTABLE_CONTEXT_ENTRY_SIZE, NULL, true},
Thomas Zimmermann fdc716
 	{VMWGFX_NUM_GB_SHADER * SVGA3D_OTABLE_SHADER_ENTRY_SIZE, NULL, true},
Thomas Zimmermann fdc716
 	{VMWGFX_NUM_GB_SCREEN_TARGET * SVGA3D_OTABLE_SCREEN_TARGET_ENTRY_SIZE,
Thomas Zimmermann fdc716
-	 NULL, VMWGFX_ENABLE_SCREEN_TARGET_OTABLE}
Thomas Zimmermann fdc716
+	 NULL, true}
Thomas Zimmermann fdc716
 };
Thomas Zimmermann fdc716
 
Thomas Zimmermann fdc716
 static const struct vmw_otable dx_tables[] = {
Thomas Zimmermann fdc716
@@ -84,7 +78,7 @@ static const struct vmw_otable dx_tables
Thomas Zimmermann fdc716
 	{VMWGFX_NUM_GB_CONTEXT * SVGA3D_OTABLE_CONTEXT_ENTRY_SIZE, NULL, true},
Thomas Zimmermann fdc716
 	{VMWGFX_NUM_GB_SHADER * SVGA3D_OTABLE_SHADER_ENTRY_SIZE, NULL, true},
Thomas Zimmermann fdc716
 	{VMWGFX_NUM_GB_SCREEN_TARGET * SVGA3D_OTABLE_SCREEN_TARGET_ENTRY_SIZE,
Thomas Zimmermann fdc716
-	 NULL, VMWGFX_ENABLE_SCREEN_TARGET_OTABLE},
Thomas Zimmermann fdc716
+	 NULL, true},
Thomas Zimmermann fdc716
 	{VMWGFX_NUM_DXCONTEXT * sizeof(SVGAOTableDXContextEntry), NULL, true},
Thomas Zimmermann fdc716
 };
Thomas Zimmermann fdc716
 
Thomas Zimmermann fdc716
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c
Thomas Zimmermann fdc716
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c
Thomas Zimmermann fdc716
@@ -1865,8 +1865,8 @@ int vmw_kms_stdu_init_display(struct vmw
Thomas Zimmermann fdc716
 	int i, ret;
Thomas Zimmermann fdc716
 
Thomas Zimmermann fdc716
 
Thomas Zimmermann fdc716
-	/* Do nothing if Screen Target support is turned off */
Thomas Zimmermann fdc716
-	if (!VMWGFX_ENABLE_SCREEN_TARGET_OTABLE || !dev_priv->has_mob)
Thomas Zimmermann fdc716
+	/* Do nothing if there's no support for MOBs */
Thomas Zimmermann fdc716
+	if (!dev_priv->has_mob)
Thomas Zimmermann fdc716
 		return -ENOSYS;
Thomas Zimmermann fdc716
 
Thomas Zimmermann fdc716
 	if (!(dev_priv->capabilities & SVGA_CAP_GBOBJECTS))