[PATCH 4/9] drm/amdgpu: init zfb start address and size

Feifei Xu Feifei.Xu at amd.com
Wed Feb 7 12:34:47 UTC 2018


Use module parameter passed from user to initialize zfb start
address and size.

Change-Id: Idd0ae02ef8010ec36baa4b03b01981e97b3e748a
Signed-off-by: Feifei Xu <Feifei.Xu at amd.com>
Signed-off-by: Hawking Zhang <Hawking.Zhang at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index dc8f221..519f09f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -859,6 +859,18 @@ static void amdgpu_device_check_arguments(struct amdgpu_device *adev)
 		dev_warn(adev->dev, "lockup_timeout msut be > 0, adjusting to 10000\n");
 		amdgpu_lockup_timeout = 10000;
 	}
+
+	if (amdgpu_zfb[0] > 0) {
+		dev_warn(adev->dev,
+			 "Zero Frame Buffer is enabled\n");
+		adev->gmc.enable_zfb = true;
+		adev->gmc.zfb_phys_addr = amdgpu_zfb[1] << 20;
+        adev->gmc.zfb_size = amdgpu_zfb[0] << 20;
+	} else {
+		adev->gmc.enable_zfb = false;
+		adev->gmc.zfb_phys_addr = 0;
+		adev->gmc.zfb_size = 0;
+	}
 }
 
 /**
-- 
2.7.4



More information about the amd-gfx mailing list