Blob Blame History Raw
From 29f31623d7a83048b1c90a4db89b6f325bfde942 Mon Sep 17 00:00:00 2001
From: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu, 18 May 2017 10:46:15 +0100
Subject: [PATCH] drm/i915/selftests: Pretend to be a gfx pci device
Git-commit: 29f31623d7a83048b1c90a4db89b6f325bfde942
Patch-mainline: v4.13-rc1
References: FATE#322643 bsc#1055900

Set the class on our mock pci device to GFX. This should be useful for
utilities like intel-iommu that special case gfx devices.

References: https://bugs.freedesktop.org/show_bug.cgi?id=101080
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/20170518094638.5469-1-chris@chris-wilson.co.uk
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Acked-by: Takashi Iwai <tiwai@suse.de>

---
 drivers/gpu/drm/i915/selftests/mock_gem_device.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c
+++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
@@ -121,6 +121,7 @@ struct drm_i915_private *mock_gem_device
 		goto err;
 
 	device_initialize(&pdev->dev);
+	pdev->class = PCI_BASE_CLASS_DISPLAY << 16;
 	pdev->dev.release = release_dev;
 	dev_set_name(&pdev->dev, "mock");
 	dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));