* [Intel-gfx] [PATCH v3 0/8] drm: Move struct drm_device.pdev to legacy
@ 2021-01-07 8:07 Thomas Zimmermann
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 1/8] drm/amdgpu: Fix trailing whitespaces Thomas Zimmermann
` (8 more replies)
0 siblings, 9 replies; 20+ messages in thread
From: Thomas Zimmermann @ 2021-01-07 8:07 UTC (permalink / raw)
To: airlied, daniel, jani.nikula, joonas.lahtinen, rodrigo.vivi
Cc: nouveau, intel-gfx, dri-devel, amd-gfx, Thomas Zimmermann, intel-gvt-dev
I merged many of the patches that were ready in v2 into drm-misc-next. In
v3 remain only patches that need an r-b/a-b (i915/gt/gvt) or required
a change from v2.
The pdev field in struct drm_device points to a PCI device structure and
goes back to UMS-only days when all DRM drivers were for PCI devices.
Meanwhile we also support USB, SPI and platform devices. Each of those
uses the generic device stored in struct drm_device.dev.
To reduce duplication and remove the special case of PCI, this patchset
converts all modesetting drivers from pdev to dev and makes pdev a field
for legacy UMS drivers.
For PCI devices, the pointer in struct drm_device.dev can be upcasted to
struct pci_device; or tested for PCI with dev_is_pci(). In several places
the code can use the dev field directly.
After converting all drivers and the DRM core, the pdev fields becomes
only relevant for legacy drivers. In a later patchset, we may want to
convert these as well and remove pdev entirely.
v3:
* fix one pdev reference in nouveau (Jeremy)
* rebases
v2:
* move whitespace fixes into separate patches (Alex, Sam)
* move i915 gt/ and gvt/ changes into separate patches (Joonas)
Thomas Zimmermann (8):
drm/amdgpu: Fix trailing whitespaces
drm/amdgpu: Remove references to struct drm_device.pdev
drm/hibmc: Remove references to struct drm_device.pdev
drm/i915: Remove references to struct drm_device.pdev
drm/i915/gt: Remove references to struct drm_device.pdev
drm/i915/gvt: Remove references to struct drm_device.pdev
drm/nouveau: Remove references to struct drm_device.pdev
drm: Upcast struct drm_device.dev to struct pci_device; replace pdev
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 23 ++++---
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 1 +
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 -
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 10 +--
drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 10 +--
drivers/gpu/drm/drm_agpsupport.c | 9 ++-
drivers/gpu/drm/drm_bufs.c | 4 +-
drivers/gpu/drm/drm_edid.c | 7 ++-
drivers/gpu/drm/drm_irq.c | 12 ++--
drivers/gpu/drm/drm_pci.c | 26 ++++----
drivers/gpu/drm/drm_vm.c | 2 +-
.../gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 13 ++--
.../gpu/drm/hisilicon/hibmc/hibmc_drm_i2c.c | 2 +-
drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c | 61 +++++++++++++++++++
drivers/gpu/drm/i915/display/intel_bios.c | 2 +-
drivers/gpu/drm/i915/display/intel_cdclk.c | 14 ++---
drivers/gpu/drm/i915/display/intel_csr.c | 2 +-
drivers/gpu/drm/i915/display/intel_dsi_vbt.c | 2 +-
drivers/gpu/drm/i915/display/intel_fbdev.c | 2 +-
drivers/gpu/drm/i915/display/intel_gmbus.c | 2 +-
.../gpu/drm/i915/display/intel_lpe_audio.c | 5 +-
drivers/gpu/drm/i915/display/intel_opregion.c | 6 +-
drivers/gpu/drm/i915/display/intel_overlay.c | 2 +-
drivers/gpu/drm/i915/display/intel_panel.c | 4 +-
drivers/gpu/drm/i915/display/intel_quirks.c | 2 +-
drivers/gpu/drm/i915/display/intel_sdvo.c | 2 +-
drivers/gpu/drm/i915/display/intel_vga.c | 8 +--
drivers/gpu/drm/i915/gem/i915_gem_phys.c | 6 +-
drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 2 +-
drivers/gpu/drm/i915/gt/intel_engine_cs.c | 2 +-
drivers/gpu/drm/i915/gt/intel_ggtt.c | 10 +--
drivers/gpu/drm/i915/gt/intel_ppgtt.c | 2 +-
drivers/gpu/drm/i915/gt/intel_rc6.c | 4 +-
drivers/gpu/drm/i915/gt/intel_reset.c | 6 +-
drivers/gpu/drm/i915/gvt/cfg_space.c | 5 +-
drivers/gpu/drm/i915/gvt/firmware.c | 10 +--
drivers/gpu/drm/i915/gvt/gtt.c | 12 ++--
drivers/gpu/drm/i915/gvt/gvt.c | 6 +-
drivers/gpu/drm/i915/gvt/kvmgt.c | 4 +-
drivers/gpu/drm/i915/i915_debugfs.c | 2 +-
drivers/gpu/drm/i915/i915_drv.c | 20 +++---
drivers/gpu/drm/i915/i915_drv.h | 2 +-
drivers/gpu/drm/i915/i915_gem_gtt.c | 5 +-
drivers/gpu/drm/i915/i915_getparam.c | 5 +-
drivers/gpu/drm/i915/i915_gpu_error.c | 2 +-
drivers/gpu/drm/i915/i915_irq.c | 6 +-
drivers/gpu/drm/i915/i915_pmu.c | 2 +-
drivers/gpu/drm/i915/i915_suspend.c | 4 +-
drivers/gpu/drm/i915/i915_switcheroo.c | 4 +-
drivers/gpu/drm/i915/i915_vgpu.c | 2 +-
drivers/gpu/drm/i915/intel_device_info.c | 2 +-
drivers/gpu/drm/i915/intel_region_lmem.c | 8 +--
drivers/gpu/drm/i915/intel_runtime_pm.c | 2 +-
drivers/gpu/drm/i915/intel_uncore.c | 4 +-
.../gpu/drm/i915/selftests/mock_gem_device.c | 1 -
drivers/gpu/drm/i915/selftests/mock_gtt.c | 2 +-
drivers/gpu/drm/nouveau/dispnv04/arb.c | 12 ++--
drivers/gpu/drm/nouveau/dispnv04/dfp.c | 5 +-
drivers/gpu/drm/nouveau/dispnv04/disp.h | 14 +++--
drivers/gpu/drm/nouveau/dispnv04/hw.c | 10 +--
drivers/gpu/drm/nouveau/nouveau_abi16.c | 7 ++-
drivers/gpu/drm/nouveau/nouveau_acpi.c | 2 +-
drivers/gpu/drm/nouveau/nouveau_bios.c | 11 +++-
drivers/gpu/drm/nouveau/nouveau_connector.c | 10 +--
drivers/gpu/drm/nouveau/nouveau_drm.c | 5 +-
drivers/gpu/drm/nouveau/nouveau_fbcon.c | 6 +-
drivers/gpu/drm/nouveau/nouveau_vga.c | 20 +++---
include/drm/drm_device.h | 12 +++-
70 files changed, 296 insertions(+), 198 deletions(-)
create mode 100644 drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c
--
2.29.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Intel-gfx] [PATCH v3 1/8] drm/amdgpu: Fix trailing whitespaces
2021-01-07 8:07 [Intel-gfx] [PATCH v3 0/8] drm: Move struct drm_device.pdev to legacy Thomas Zimmermann
@ 2021-01-07 8:07 ` Thomas Zimmermann
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 2/8] drm/amdgpu: Remove references to struct drm_device.pdev Thomas Zimmermann
` (7 subsequent siblings)
8 siblings, 0 replies; 20+ messages in thread
From: Thomas Zimmermann @ 2021-01-07 8:07 UTC (permalink / raw)
To: airlied, daniel, jani.nikula, joonas.lahtinen, rodrigo.vivi
Cc: Sam Ravnborg, nouveau, intel-gfx, dri-devel, amd-gfx,
Thomas Zimmermann, Alex Deucher, intel-gvt-dev,
Christian König
Adhere to kernel coding style.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 8f451e809127..7d16395ede0a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -4950,8 +4950,8 @@ pci_ers_result_t amdgpu_pci_error_detected(struct pci_dev *pdev, pci_channel_sta
case pci_channel_io_normal:
return PCI_ERS_RESULT_CAN_RECOVER;
/* Fatal error, prepare for slot reset */
- case pci_channel_io_frozen:
- /*
+ case pci_channel_io_frozen:
+ /*
* Cancel and wait for all TDRs in progress if failing to
* set adev->in_gpu_reset in amdgpu_device_lock_adev
*
@@ -5042,7 +5042,7 @@ pci_ers_result_t amdgpu_pci_slot_reset(struct pci_dev *pdev)
goto out;
}
- adev->in_pci_err_recovery = true;
+ adev->in_pci_err_recovery = true;
r = amdgpu_device_pre_asic_reset(adev, NULL, &need_full_reset);
adev->in_pci_err_recovery = false;
if (r)
--
2.29.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [Intel-gfx] [PATCH v3 2/8] drm/amdgpu: Remove references to struct drm_device.pdev
2021-01-07 8:07 [Intel-gfx] [PATCH v3 0/8] drm: Move struct drm_device.pdev to legacy Thomas Zimmermann
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 1/8] drm/amdgpu: Fix trailing whitespaces Thomas Zimmermann
@ 2021-01-07 8:07 ` Thomas Zimmermann
2021-01-18 13:50 ` Christian König
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 3/8] drm/hibmc: " Thomas Zimmermann
` (6 subsequent siblings)
8 siblings, 1 reply; 20+ messages in thread
From: Thomas Zimmermann @ 2021-01-07 8:07 UTC (permalink / raw)
To: airlied, daniel, jani.nikula, joonas.lahtinen, rodrigo.vivi
Cc: Sam Ravnborg, nouveau, intel-gfx, dri-devel, amd-gfx,
Thomas Zimmermann, Alex Deucher, intel-gvt-dev,
Christian König
Using struct drm_device.pdev is deprecated. Convert amdgpu to struct
drm_device.dev. No functional changes.
v3:
* rebased
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 17 ++++++++---------
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 1 +
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 -
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 10 +++++-----
drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 10 +++++-----
7 files changed, 21 insertions(+), 22 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 7d16395ede0a..f7e2a878411e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1423,9 +1423,9 @@ static void amdgpu_switcheroo_set_state(struct pci_dev *pdev,
/* don't suspend or resume card normally */
dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
- pci_set_power_state(dev->pdev, PCI_D0);
- amdgpu_device_load_pci_state(dev->pdev);
- r = pci_enable_device(dev->pdev);
+ pci_set_power_state(pdev, PCI_D0);
+ amdgpu_device_load_pci_state(pdev);
+ r = pci_enable_device(pdev);
if (r)
DRM_WARN("pci_enable_device failed (%d)\n", r);
amdgpu_device_resume(dev, true);
@@ -1437,10 +1437,10 @@ static void amdgpu_switcheroo_set_state(struct pci_dev *pdev,
drm_kms_helper_poll_disable(dev);
dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
amdgpu_device_suspend(dev, true);
- amdgpu_device_cache_pci_state(dev->pdev);
+ amdgpu_device_cache_pci_state(pdev);
/* Shut down the device */
- pci_disable_device(dev->pdev);
- pci_set_power_state(dev->pdev, PCI_D3cold);
+ pci_disable_device(pdev);
+ pci_set_power_state(pdev, PCI_D3cold);
dev->switch_power_state = DRM_SWITCH_POWER_OFF;
}
}
@@ -1703,8 +1703,7 @@ static void amdgpu_device_enable_virtual_display(struct amdgpu_device *adev)
adev->enable_virtual_display = false;
if (amdgpu_virtual_display) {
- struct drm_device *ddev = adev_to_drm(adev);
- const char *pci_address_name = pci_name(ddev->pdev);
+ const char *pci_address_name = pci_name(adev->pdev);
char *pciaddstr, *pciaddstr_tmp, *pciaddname_tmp, *pciaddname;
pciaddstr = kstrdup(amdgpu_virtual_display, GFP_KERNEL);
@@ -3397,7 +3396,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
}
}
- pci_enable_pcie_error_reporting(adev->ddev.pdev);
+ pci_enable_pcie_error_reporting(adev->pdev);
/* Post card if necessary */
if (amdgpu_device_need_post(adev)) {
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index f764803c53a4..0150a51b65ef 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -926,6 +926,7 @@ amdgpu_display_user_framebuffer_create(struct drm_device *dev,
struct drm_file *file_priv,
const struct drm_mode_fb_cmd2 *mode_cmd)
{
+ struct amdgpu_device *adev = drm_to_adev(dev);
struct drm_gem_object *obj;
struct amdgpu_framebuffer *amdgpu_fb;
int ret;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 72efd579ec5e..b4ea67e12ada 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -1204,7 +1204,6 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
if (ret)
return ret;
- ddev->pdev = pdev;
pci_set_drvdata(pdev, ddev);
ret = amdgpu_driver_load_kms(adev, ent->driver_data);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
index 0bf7d36c6686..51cd49c6f38f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
@@ -271,7 +271,7 @@ static int amdgpufb_create(struct drm_fb_helper *helper,
DRM_INFO("fb depth is %d\n", fb->format->depth);
DRM_INFO(" pitch is %d\n", fb->pitches[0]);
- vga_switcheroo_client_fb_set(adev_to_drm(adev)->pdev, info);
+ vga_switcheroo_client_fb_set(adev->pdev, info);
return 0;
out:
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index d0a1fee1f5f6..a5c42c3004a0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -619,7 +619,7 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev, void *data,
int r = 0;
if (args->va_address < AMDGPU_VA_RESERVED_SIZE) {
- dev_dbg(&dev->pdev->dev,
+ dev_dbg(dev->dev,
"va_address 0x%LX is in reserved area 0x%LX\n",
args->va_address, AMDGPU_VA_RESERVED_SIZE);
return -EINVAL;
@@ -627,7 +627,7 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev, void *data,
if (args->va_address >= AMDGPU_GMC_HOLE_START &&
args->va_address < AMDGPU_GMC_HOLE_END) {
- dev_dbg(&dev->pdev->dev,
+ dev_dbg(dev->dev,
"va_address 0x%LX is in VA hole 0x%LX-0x%LX\n",
args->va_address, AMDGPU_GMC_HOLE_START,
AMDGPU_GMC_HOLE_END);
@@ -639,14 +639,14 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev, void *data,
vm_size = adev->vm_manager.max_pfn * AMDGPU_GPU_PAGE_SIZE;
vm_size -= AMDGPU_VA_RESERVED_SIZE;
if (args->va_address + args->map_size > vm_size) {
- dev_dbg(&dev->pdev->dev,
+ dev_dbg(dev->dev,
"va_address 0x%llx is in top reserved area 0x%llx\n",
args->va_address + args->map_size, vm_size);
return -EINVAL;
}
if ((args->flags & ~valid_flags) && (args->flags & ~prt_flags)) {
- dev_dbg(&dev->pdev->dev, "invalid flags combination 0x%08X\n",
+ dev_dbg(dev->dev, "invalid flags combination 0x%08X\n",
args->flags);
return -EINVAL;
}
@@ -658,7 +658,7 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev, void *data,
case AMDGPU_VA_OP_REPLACE:
break;
default:
- dev_dbg(&dev->pdev->dev, "unsupported operation %d\n",
+ dev_dbg(dev->dev, "unsupported operation %d\n",
args->operation);
return -EINVAL;
}
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
index 47cad23a6b9e..bca4dddd5a15 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
@@ -176,7 +176,7 @@ struct amdgpu_i2c_chan *amdgpu_i2c_create(struct drm_device *dev,
i2c->rec = *rec;
i2c->adapter.owner = THIS_MODULE;
i2c->adapter.class = I2C_CLASS_DDC;
- i2c->adapter.dev.parent = &dev->pdev->dev;
+ i2c->adapter.dev.parent = dev->dev;
i2c->dev = dev;
i2c_set_adapdata(&i2c->adapter, i2c);
mutex_init(&i2c->mutex);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index b16b32797624..3c37cf1ae8b7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -142,7 +142,7 @@ int amdgpu_driver_load_kms(struct amdgpu_device *adev, unsigned long flags)
(amdgpu_is_atpx_hybrid() ||
amdgpu_has_atpx_dgpu_power_cntl()) &&
((flags & AMD_IS_APU) == 0) &&
- !pci_is_thunderbolt_attached(dev->pdev))
+ !pci_is_thunderbolt_attached(to_pci_dev(dev->dev)))
flags |= AMD_IS_PX;
parent = pci_upstream_bridge(adev->pdev);
@@ -156,7 +156,7 @@ int amdgpu_driver_load_kms(struct amdgpu_device *adev, unsigned long flags)
*/
r = amdgpu_device_init(adev, flags);
if (r) {
- dev_err(&dev->pdev->dev, "Fatal error during GPU init\n");
+ dev_err(dev->dev, "Fatal error during GPU init\n");
goto out;
}
@@ -199,7 +199,7 @@ int amdgpu_driver_load_kms(struct amdgpu_device *adev, unsigned long flags)
acpi_status = amdgpu_acpi_init(adev);
if (acpi_status)
- dev_dbg(&dev->pdev->dev, "Error during ACPI methods call\n");
+ dev_dbg(dev->dev, "Error during ACPI methods call\n");
if (adev->runpm) {
/* only need to skip on ATPX */
@@ -735,10 +735,10 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
if (!dev_info)
return -ENOMEM;
- dev_info->device_id = dev->pdev->device;
+ dev_info->device_id = adev->pdev->device;
dev_info->chip_rev = adev->rev_id;
dev_info->external_rev = adev->external_rev_id;
- dev_info->pci_rev = dev->pdev->revision;
+ dev_info->pci_rev = adev->pdev->revision;
dev_info->family = adev->family;
dev_info->num_shader_engines = adev->gfx.config.max_shader_engines;
dev_info->num_shader_arrays_per_engine = adev->gfx.config.max_sh_per_se;
--
2.29.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [Intel-gfx] [PATCH v3 3/8] drm/hibmc: Remove references to struct drm_device.pdev
2021-01-07 8:07 [Intel-gfx] [PATCH v3 0/8] drm: Move struct drm_device.pdev to legacy Thomas Zimmermann
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 1/8] drm/amdgpu: Fix trailing whitespaces Thomas Zimmermann
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 2/8] drm/amdgpu: Remove references to struct drm_device.pdev Thomas Zimmermann
@ 2021-01-07 8:07 ` Thomas Zimmermann
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 4/8] drm/i915: " Thomas Zimmermann
` (5 subsequent siblings)
8 siblings, 0 replies; 20+ messages in thread
From: Thomas Zimmermann @ 2021-01-07 8:07 UTC (permalink / raw)
To: airlied, daniel, jani.nikula, joonas.lahtinen, rodrigo.vivi
Cc: Sam Ravnborg, Xinliang Liu, nouveau, intel-gfx, dri-devel,
Xinwei Kong, John Stultz, amd-gfx, Thomas Zimmermann, Chen Feng,
Tian Tao, intel-gvt-dev
Using struct drm_device.pdev is deprecated. Convert hibmc to struct
drm_device.dev. No functional changes.
v3:
* rebased
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Tian Tao <tiantao6@hisilicon.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Xinliang Liu <xinliang.liu@linaro.org>
Cc: Tian Tao <tiantao6@hisilicon.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Xinwei Kong <kong.kongxinwei@hisilicon.com>
Cc: Chen Feng <puck.chen@hisilicon.com>
---
.../gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 13 ++--
.../gpu/drm/hisilicon/hibmc/hibmc_drm_i2c.c | 2 +-
drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c | 61 +++++++++++++++++++
3 files changed, 68 insertions(+), 8 deletions(-)
create mode 100644 drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c
diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
index 0d4e9023f54d..0a2edc7b754a 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
@@ -210,8 +210,8 @@ static void hibmc_hw_config(struct hibmc_drm_private *priv)
static int hibmc_hw_map(struct hibmc_drm_private *priv)
{
- struct drm_device *dev = &priv->dev;
struct pci_dev *pdev = dev->pdev;
+ struct pci_dev *pdev = to_pci_dev(dev->dev);
resource_size_t addr, size, ioaddr, iosize;
ioaddr = pci_resource_start(pdev, 1);
@@ -255,13 +255,14 @@ static int hibmc_unload(struct drm_device *dev)
if (dev->irq_enabled)
drm_irq_uninstall(dev);
- pci_disable_msi(dev->pdev);
+ pci_disable_msi(to_pci_dev(dev->dev));
return 0;
}
static int hibmc_load(struct drm_device *dev)
{
+ struct pci_dev *pdev = to_pci_dev(dev->dev);
struct hibmc_drm_private *priv = to_hibmc_drm_private(dev);
int ret;
@@ -269,8 +270,7 @@ static int hibmc_load(struct drm_device *dev)
if (ret)
goto err;
- ret = drmm_vram_helper_init(dev, pci_resource_start(dev->pdev, 0),
- priv->fb_size);
+ ret = drmm_vram_helper_init(dev, pci_resource_start(pdev, 0), priv->fb_size);
if (ret) {
drm_err(dev, "Error initializing VRAM MM; %d\n", ret);
goto err;
@@ -286,11 +286,11 @@ static int hibmc_load(struct drm_device *dev)
goto err;
}
- ret = pci_enable_msi(dev->pdev);
+ ret = pci_enable_msi(pdev);
if (ret) {
drm_warn(dev, "enabling MSI failed: %d\n", ret);
} else {
- ret = drm_irq_install(dev, dev->pdev->irq);
+ ret = drm_irq_install(dev, pdev->irq);
if (ret)
drm_warn(dev, "install irq failed: %d\n", ret);
}
@@ -326,7 +326,6 @@ static int hibmc_pci_probe(struct pci_dev *pdev,
}
dev = &priv->dev;
- dev->pdev = pdev;
pci_set_drvdata(pdev, dev);
ret = pcim_enable_device(pdev);
diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_i2c.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_i2c.c
index 86d712090d87..410bd019bb35 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_i2c.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_i2c.c
@@ -83,7 +83,7 @@ int hibmc_ddc_create(struct drm_device *drm_dev,
connector->adapter.owner = THIS_MODULE;
connector->adapter.class = I2C_CLASS_DDC;
snprintf(connector->adapter.name, I2C_NAME_SIZE, "HIS i2c bit bus");
- connector->adapter.dev.parent = &drm_dev->pdev->dev;
+ connector->adapter.dev.parent = drm_dev->dev;
i2c_set_adapdata(&connector->adapter, connector);
connector->adapter.algo_data = &connector->bit_data;
diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c
new file mode 100644
index 000000000000..77f075075db2
--- /dev/null
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c
@@ -0,0 +1,61 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/* Hisilicon Hibmc SoC drm driver
+ *
+ * Based on the bochs drm driver.
+ *
+ * Copyright (c) 2016 Huawei Limited.
+ *
+ * Author:
+ * Rongrong Zou <zourongrong@huawei.com>
+ * Rongrong Zou <zourongrong@gmail.com>
+ * Jianhua Li <lijianhua@huawei.com>
+ */
+
+#include <linux/pci.h>
+
+#include <drm/drm_atomic_helper.h>
+#include <drm/drm_gem.h>
+#include <drm/drm_gem_framebuffer_helper.h>
+#include <drm/drm_gem_vram_helper.h>
+#include <drm/drm_print.h>
+
+#include "hibmc_drm_drv.h"
+
+int hibmc_mm_init(struct hibmc_drm_private *hibmc)
+{
+ struct drm_vram_mm *vmm;
+ int ret;
+ struct drm_device *dev = hibmc->dev;
+ struct pci_dev *pdev = to_pci_dev(dev->dev);
+
+ vmm = drm_vram_helper_alloc_mm(dev, pci_resource_start(pdev, 0),
+ hibmc->fb_size);
+ if (IS_ERR(vmm)) {
+ ret = PTR_ERR(vmm);
+ drm_err(dev, "Error initializing VRAM MM; %d\n", ret);
+ return ret;
+ }
+
+ return 0;
+}
+
+void hibmc_mm_fini(struct hibmc_drm_private *hibmc)
+{
+ if (!hibmc->dev->vram_mm)
+ return;
+
+ drm_vram_helper_release_mm(hibmc->dev);
+}
+
+int hibmc_dumb_create(struct drm_file *file, struct drm_device *dev,
+ struct drm_mode_create_dumb *args)
+{
+ return drm_gem_vram_fill_create_dumb(file, dev, 0, 128, args);
+}
+
+const struct drm_mode_config_funcs hibmc_mode_funcs = {
+ .mode_valid = drm_vram_helper_mode_valid,
+ .atomic_check = drm_atomic_helper_check,
+ .atomic_commit = drm_atomic_helper_commit,
+ .fb_create = drm_gem_fb_create,
+};
--
2.29.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [Intel-gfx] [PATCH v3 4/8] drm/i915: Remove references to struct drm_device.pdev
2021-01-07 8:07 [Intel-gfx] [PATCH v3 0/8] drm: Move struct drm_device.pdev to legacy Thomas Zimmermann
` (2 preceding siblings ...)
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 3/8] drm/hibmc: " Thomas Zimmermann
@ 2021-01-07 8:07 ` Thomas Zimmermann
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 5/8] drm/i915/gt: " Thomas Zimmermann
` (4 subsequent siblings)
8 siblings, 0 replies; 20+ messages in thread
From: Thomas Zimmermann @ 2021-01-07 8:07 UTC (permalink / raw)
To: airlied, daniel, jani.nikula, joonas.lahtinen, rodrigo.vivi
Cc: nouveau, intel-gfx, dri-devel, amd-gfx, Thomas Zimmermann, intel-gvt-dev
Using struct drm_device.pdev is deprecated. Convert i915 to struct
drm_device.dev. No functional changes.
v3:
* rebased
v2:
* move gt/ and gvt/ changes into separate patches
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
drivers/gpu/drm/i915/display/intel_bios.c | 2 +-
drivers/gpu/drm/i915/display/intel_cdclk.c | 14 ++++++-------
drivers/gpu/drm/i915/display/intel_csr.c | 2 +-
drivers/gpu/drm/i915/display/intel_dsi_vbt.c | 2 +-
drivers/gpu/drm/i915/display/intel_fbdev.c | 2 +-
drivers/gpu/drm/i915/display/intel_gmbus.c | 2 +-
.../gpu/drm/i915/display/intel_lpe_audio.c | 5 +++--
drivers/gpu/drm/i915/display/intel_opregion.c | 6 +++---
drivers/gpu/drm/i915/display/intel_overlay.c | 2 +-
drivers/gpu/drm/i915/display/intel_panel.c | 4 ++--
drivers/gpu/drm/i915/display/intel_quirks.c | 2 +-
drivers/gpu/drm/i915/display/intel_sdvo.c | 2 +-
drivers/gpu/drm/i915/display/intel_vga.c | 8 ++++----
drivers/gpu/drm/i915/gem/i915_gem_phys.c | 6 +++---
drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 2 +-
drivers/gpu/drm/i915/i915_debugfs.c | 2 +-
drivers/gpu/drm/i915/i915_drv.c | 20 +++++++++----------
drivers/gpu/drm/i915/i915_drv.h | 2 +-
drivers/gpu/drm/i915/i915_gem_gtt.c | 5 ++---
drivers/gpu/drm/i915/i915_getparam.c | 5 +++--
drivers/gpu/drm/i915/i915_gpu_error.c | 2 +-
drivers/gpu/drm/i915/i915_irq.c | 6 +++---
drivers/gpu/drm/i915/i915_pmu.c | 2 +-
drivers/gpu/drm/i915/i915_suspend.c | 4 ++--
drivers/gpu/drm/i915/i915_switcheroo.c | 4 ++--
drivers/gpu/drm/i915/i915_vgpu.c | 2 +-
drivers/gpu/drm/i915/intel_device_info.c | 2 +-
drivers/gpu/drm/i915/intel_region_lmem.c | 8 ++++----
drivers/gpu/drm/i915/intel_runtime_pm.c | 2 +-
drivers/gpu/drm/i915/intel_uncore.c | 4 ++--
.../gpu/drm/i915/selftests/mock_gem_device.c | 1 -
drivers/gpu/drm/i915/selftests/mock_gtt.c | 2 +-
32 files changed, 66 insertions(+), 68 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index 06c3310446a2..6144872cf3aa 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -2088,7 +2088,7 @@ bool intel_bios_is_valid_vbt(const void *buf, size_t size)
static struct vbt_header *oprom_get_vbt(struct drm_i915_private *dev_priv)
{
- struct pci_dev *pdev = dev_priv->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
void __iomem *p = NULL, *oprom;
struct vbt_header *vbt;
u16 vbt_size;
diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c
index 2e878cc274b7..bf83e9e75227 100644
--- a/drivers/gpu/drm/i915/display/intel_cdclk.c
+++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
@@ -96,7 +96,7 @@ static void fixed_450mhz_get_cdclk(struct drm_i915_private *dev_priv,
static void i85x_get_cdclk(struct drm_i915_private *dev_priv,
struct intel_cdclk_config *cdclk_config)
{
- struct pci_dev *pdev = dev_priv->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
u16 hpllcc = 0;
/*
@@ -138,7 +138,7 @@ static void i85x_get_cdclk(struct drm_i915_private *dev_priv,
static void i915gm_get_cdclk(struct drm_i915_private *dev_priv,
struct intel_cdclk_config *cdclk_config)
{
- struct pci_dev *pdev = dev_priv->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
u16 gcfgc = 0;
pci_read_config_word(pdev, GCFGC, &gcfgc);
@@ -162,7 +162,7 @@ static void i915gm_get_cdclk(struct drm_i915_private *dev_priv,
static void i945gm_get_cdclk(struct drm_i915_private *dev_priv,
struct intel_cdclk_config *cdclk_config)
{
- struct pci_dev *pdev = dev_priv->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
u16 gcfgc = 0;
pci_read_config_word(pdev, GCFGC, &gcfgc);
@@ -256,7 +256,7 @@ static unsigned int intel_hpll_vco(struct drm_i915_private *dev_priv)
static void g33_get_cdclk(struct drm_i915_private *dev_priv,
struct intel_cdclk_config *cdclk_config)
{
- struct pci_dev *pdev = dev_priv->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
static const u8 div_3200[] = { 12, 10, 8, 7, 5, 16 };
static const u8 div_4000[] = { 14, 12, 10, 8, 6, 20 };
static const u8 div_4800[] = { 20, 14, 12, 10, 8, 24 };
@@ -305,7 +305,7 @@ static void g33_get_cdclk(struct drm_i915_private *dev_priv,
static void pnv_get_cdclk(struct drm_i915_private *dev_priv,
struct intel_cdclk_config *cdclk_config)
{
- struct pci_dev *pdev = dev_priv->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
u16 gcfgc = 0;
pci_read_config_word(pdev, GCFGC, &gcfgc);
@@ -339,7 +339,7 @@ static void pnv_get_cdclk(struct drm_i915_private *dev_priv,
static void i965gm_get_cdclk(struct drm_i915_private *dev_priv,
struct intel_cdclk_config *cdclk_config)
{
- struct pci_dev *pdev = dev_priv->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
static const u8 div_3200[] = { 16, 10, 8 };
static const u8 div_4000[] = { 20, 12, 10 };
static const u8 div_5333[] = { 24, 16, 14 };
@@ -384,7 +384,7 @@ static void i965gm_get_cdclk(struct drm_i915_private *dev_priv,
static void gm45_get_cdclk(struct drm_i915_private *dev_priv,
struct intel_cdclk_config *cdclk_config)
{
- struct pci_dev *pdev = dev_priv->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
unsigned int cdclk_sel;
u16 tmp = 0;
diff --git a/drivers/gpu/drm/i915/display/intel_csr.c b/drivers/gpu/drm/i915/display/intel_csr.c
index 67dc64df78a5..19cbcab69689 100644
--- a/drivers/gpu/drm/i915/display/intel_csr.c
+++ b/drivers/gpu/drm/i915/display/intel_csr.c
@@ -640,7 +640,7 @@ static void csr_load_work_fn(struct work_struct *work)
dev_priv = container_of(work, typeof(*dev_priv), csr.work);
csr = &dev_priv->csr;
- request_firmware(&fw, dev_priv->csr.fw_path, &dev_priv->drm.pdev->dev);
+ request_firmware(&fw, dev_priv->csr.fw_path, dev_priv->drm.dev);
parse_csr_fw(dev_priv, fw);
if (dev_priv->csr.dmc_payload) {
diff --git a/drivers/gpu/drm/i915/display/intel_dsi_vbt.c b/drivers/gpu/drm/i915/display/intel_dsi_vbt.c
index eed037ec0b29..e349caef1926 100644
--- a/drivers/gpu/drm/i915/display/intel_dsi_vbt.c
+++ b/drivers/gpu/drm/i915/display/intel_dsi_vbt.c
@@ -425,7 +425,7 @@ static void i2c_acpi_find_adapter(struct intel_dsi *intel_dsi,
const u16 slave_addr)
{
struct drm_device *drm_dev = intel_dsi->base.base.dev;
- struct device *dev = &drm_dev->pdev->dev;
+ struct device *dev = drm_dev->dev;
struct acpi_device *acpi_dev;
struct list_head resource_list;
struct i2c_adapter_lookup lookup;
diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
index 842c04e63214..4ccb462bd497 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
@@ -167,7 +167,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
struct intel_framebuffer *intel_fb = ifbdev->fb;
struct drm_device *dev = helper->dev;
struct drm_i915_private *dev_priv = to_i915(dev);
- struct pci_dev *pdev = dev_priv->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
struct i915_ggtt *ggtt = &dev_priv->ggtt;
const struct i915_ggtt_view view = {
.type = I915_GGTT_VIEW_NORMAL,
diff --git a/drivers/gpu/drm/i915/display/intel_gmbus.c b/drivers/gpu/drm/i915/display/intel_gmbus.c
index b0d71bbbf2ad..0c952e1d720e 100644
--- a/drivers/gpu/drm/i915/display/intel_gmbus.c
+++ b/drivers/gpu/drm/i915/display/intel_gmbus.c
@@ -840,7 +840,7 @@ static const struct i2c_lock_operations gmbus_lock_ops = {
*/
int intel_gmbus_setup(struct drm_i915_private *dev_priv)
{
- struct pci_dev *pdev = dev_priv->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
struct intel_gmbus *bus;
unsigned int pin;
int ret;
diff --git a/drivers/gpu/drm/i915/display/intel_lpe_audio.c b/drivers/gpu/drm/i915/display/intel_lpe_audio.c
index 1c939f9c9bc9..7f3c638c8950 100644
--- a/drivers/gpu/drm/i915/display/intel_lpe_audio.c
+++ b/drivers/gpu/drm/i915/display/intel_lpe_audio.c
@@ -80,6 +80,7 @@ static struct platform_device *
lpe_audio_platdev_create(struct drm_i915_private *dev_priv)
{
struct drm_device *dev = &dev_priv->drm;
+ struct pci_dev *pdev = to_pci_dev(dev->dev);
struct platform_device_info pinfo = {};
struct resource *rsc;
struct platform_device *platdev;
@@ -99,9 +100,9 @@ lpe_audio_platdev_create(struct drm_i915_private *dev_priv)
rsc[0].flags = IORESOURCE_IRQ;
rsc[0].name = "hdmi-lpe-audio-irq";
- rsc[1].start = pci_resource_start(dev->pdev, 0) +
+ rsc[1].start = pci_resource_start(pdev, 0) +
I915_HDMI_LPE_AUDIO_BASE;
- rsc[1].end = pci_resource_start(dev->pdev, 0) +
+ rsc[1].end = pci_resource_start(pdev, 0) +
I915_HDMI_LPE_AUDIO_BASE + I915_HDMI_LPE_AUDIO_SIZE - 1;
rsc[1].flags = IORESOURCE_MEM;
rsc[1].name = "hdmi-lpe-audio-mmio";
diff --git a/drivers/gpu/drm/i915/display/intel_opregion.c b/drivers/gpu/drm/i915/display/intel_opregion.c
index 4f77cf849171..dfd724e506b5 100644
--- a/drivers/gpu/drm/i915/display/intel_opregion.c
+++ b/drivers/gpu/drm/i915/display/intel_opregion.c
@@ -247,7 +247,7 @@ static int swsci(struct drm_i915_private *dev_priv,
u32 function, u32 parm, u32 *parm_out)
{
struct opregion_swsci *swsci = dev_priv->opregion.swsci;
- struct pci_dev *pdev = dev_priv->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
u32 main_function, sub_function, scic;
u16 swsci_val;
u32 dslp;
@@ -807,7 +807,7 @@ static int intel_load_vbt_firmware(struct drm_i915_private *dev_priv)
if (!name || !*name)
return -ENOENT;
- ret = request_firmware(&fw, name, &dev_priv->drm.pdev->dev);
+ ret = request_firmware(&fw, name, dev_priv->drm.dev);
if (ret) {
drm_err(&dev_priv->drm,
"Requesting VBT firmware \"%s\" failed (%d)\n",
@@ -840,7 +840,7 @@ static int intel_load_vbt_firmware(struct drm_i915_private *dev_priv)
int intel_opregion_setup(struct drm_i915_private *dev_priv)
{
struct intel_opregion *opregion = &dev_priv->opregion;
- struct pci_dev *pdev = dev_priv->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
u32 asls, mboxes;
char buf[sizeof(OPREGION_SIGNATURE)];
int err = 0;
diff --git a/drivers/gpu/drm/i915/display/intel_overlay.c b/drivers/gpu/drm/i915/display/intel_overlay.c
index 6be5d8946c69..cd1eb71d6e35 100644
--- a/drivers/gpu/drm/i915/display/intel_overlay.c
+++ b/drivers/gpu/drm/i915/display/intel_overlay.c
@@ -202,7 +202,7 @@ struct intel_overlay {
static void i830_overlay_clock_gating(struct drm_i915_private *dev_priv,
bool enable)
{
- struct pci_dev *pdev = dev_priv->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
u8 val;
/* WA_OVERLAY_CLKGATE:alm */
diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c
index 67f81ae995c4..d1151c657a23 100644
--- a/drivers/gpu/drm/i915/display/intel_panel.c
+++ b/drivers/gpu/drm/i915/display/intel_panel.c
@@ -557,7 +557,7 @@ static u32 i9xx_get_backlight(struct intel_connector *connector)
if (panel->backlight.combination_mode) {
u8 lbpc;
- pci_read_config_byte(dev_priv->drm.pdev, LBPC, &lbpc);
+ pci_read_config_byte(to_pci_dev(dev_priv->drm.dev), LBPC, &lbpc);
val *= lbpc;
}
@@ -631,7 +631,7 @@ static void i9xx_set_backlight(const struct drm_connector_state *conn_state, u32
lbpc = level * 0xfe / panel->backlight.max + 1;
level /= lbpc;
- pci_write_config_byte(dev_priv->drm.pdev, LBPC, lbpc);
+ pci_write_config_byte(to_pci_dev(dev_priv->drm.dev), LBPC, lbpc);
}
if (IS_GEN(dev_priv, 4)) {
diff --git a/drivers/gpu/drm/i915/display/intel_quirks.c b/drivers/gpu/drm/i915/display/intel_quirks.c
index 46beb155d835..98dd787b00e3 100644
--- a/drivers/gpu/drm/i915/display/intel_quirks.c
+++ b/drivers/gpu/drm/i915/display/intel_quirks.c
@@ -160,7 +160,7 @@ static struct intel_quirk intel_quirks[] = {
void intel_init_quirks(struct drm_i915_private *i915)
{
- struct pci_dev *d = i915->drm.pdev;
+ struct pci_dev *d = to_pci_dev(i915->drm.dev);
int i;
for (i = 0; i < ARRAY_SIZE(intel_quirks); i++) {
diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c
index 4eaa4aa86ecd..3fac60899d8e 100644
--- a/drivers/gpu/drm/i915/display/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/display/intel_sdvo.c
@@ -3281,7 +3281,7 @@ static bool
intel_sdvo_init_ddc_proxy(struct intel_sdvo *sdvo,
struct drm_i915_private *dev_priv)
{
- struct pci_dev *pdev = dev_priv->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
sdvo->ddc.owner = THIS_MODULE;
sdvo->ddc.class = I2C_CLASS_DDC;
diff --git a/drivers/gpu/drm/i915/display/intel_vga.c b/drivers/gpu/drm/i915/display/intel_vga.c
index be333699c515..5f8e4f53649d 100644
--- a/drivers/gpu/drm/i915/display/intel_vga.c
+++ b/drivers/gpu/drm/i915/display/intel_vga.c
@@ -25,7 +25,7 @@ static i915_reg_t intel_vga_cntrl_reg(struct drm_i915_private *i915)
/* Disable the VGA plane that we never use */
void intel_vga_disable(struct drm_i915_private *dev_priv)
{
- struct pci_dev *pdev = dev_priv->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
i915_reg_t vga_reg = intel_vga_cntrl_reg(dev_priv);
u8 sr1;
@@ -76,7 +76,7 @@ void intel_vga_redisable(struct drm_i915_private *i915)
void intel_vga_reset_io_mem(struct drm_i915_private *i915)
{
- struct pci_dev *pdev = i915->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
/*
* After we re-enable the power well, if we touch VGA register 0x3d5
@@ -136,7 +136,7 @@ intel_vga_set_decode(void *cookie, bool enable_decode)
int intel_vga_register(struct drm_i915_private *i915)
{
- struct pci_dev *pdev = i915->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
int ret;
/*
@@ -156,7 +156,7 @@ int intel_vga_register(struct drm_i915_private *i915)
void intel_vga_unregister(struct drm_i915_private *i915)
{
- struct pci_dev *pdev = i915->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
vga_client_register(pdev, NULL, NULL, NULL);
}
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_phys.c b/drivers/gpu/drm/i915/gem/i915_gem_phys.c
index 3a4dfe2ef1da..f47dafdda539 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_phys.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_phys.c
@@ -35,7 +35,7 @@ static int i915_gem_object_get_pages_phys(struct drm_i915_gem_object *obj)
* to handle all possible callers, and given typical object sizes,
* the alignment of the buddy allocation will naturally match.
*/
- vaddr = dma_alloc_coherent(&obj->base.dev->pdev->dev,
+ vaddr = dma_alloc_coherent(obj->base.dev->dev,
roundup_pow_of_two(obj->base.size),
&dma, GFP_KERNEL);
if (!vaddr)
@@ -83,7 +83,7 @@ static int i915_gem_object_get_pages_phys(struct drm_i915_gem_object *obj)
err_st:
kfree(st);
err_pci:
- dma_free_coherent(&obj->base.dev->pdev->dev,
+ dma_free_coherent(obj->base.dev->dev,
roundup_pow_of_two(obj->base.size),
vaddr, dma);
return -ENOMEM;
@@ -129,7 +129,7 @@ i915_gem_object_put_pages_phys(struct drm_i915_gem_object *obj,
sg_free_table(pages);
kfree(pages);
- dma_free_coherent(&obj->base.dev->pdev->dev,
+ dma_free_coherent(obj->base.dev->dev,
roundup_pow_of_two(obj->base.size),
vaddr, dma);
}
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_shmem.c b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c
index 75e8b71c18b9..08c9c25f1109 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_shmem.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c
@@ -172,7 +172,7 @@ static int shmem_get_pages(struct drm_i915_gem_object *obj)
max_segment = PAGE_SIZE;
goto rebuild_st;
} else {
- dev_warn(&i915->drm.pdev->dev,
+ dev_warn(i915->drm.dev,
"Failed to DMA remap %lu pages\n",
page_count);
goto err_pages;
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index de8e0e44cfb6..1bfb740a3d1e 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -819,7 +819,7 @@ static int i915_rps_boost_info(struct seq_file *m, void *data)
static int i915_runtime_pm_status(struct seq_file *m, void *unused)
{
struct drm_i915_private *dev_priv = node_to_i915(m->private);
- struct pci_dev *pdev = dev_priv->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
if (!HAS_RUNTIME_PM(dev_priv))
seq_puts(m, "Runtime power management not supported\n");
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 249f765993f7..7cf2b8481d2a 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -91,7 +91,7 @@ static const struct drm_driver driver;
static int i915_get_bridge_dev(struct drm_i915_private *dev_priv)
{
- int domain = pci_domain_nr(dev_priv->drm.pdev->bus);
+ int domain = pci_domain_nr(to_pci_dev(dev_priv->drm.dev)->bus);
dev_priv->bridge_dev =
pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));
@@ -458,7 +458,6 @@ static void intel_sanitize_options(struct drm_i915_private *dev_priv)
*/
static int i915_set_dma_info(struct drm_i915_private *i915)
{
- struct pci_dev *pdev = i915->drm.pdev;
unsigned int mask_size = INTEL_INFO(i915)->dma_mask_size;
int ret;
@@ -468,9 +467,9 @@ static int i915_set_dma_info(struct drm_i915_private *i915)
* We don't have a max segment size, so set it to the max so sg's
* debugging layer doesn't complain
*/
- dma_set_max_seg_size(&pdev->dev, UINT_MAX);
+ dma_set_max_seg_size(i915->drm.dev, UINT_MAX);
- ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(mask_size));
+ ret = dma_set_mask(i915->drm.dev, DMA_BIT_MASK(mask_size));
if (ret)
goto mask_err;
@@ -490,7 +489,7 @@ static int i915_set_dma_info(struct drm_i915_private *i915)
if (IS_I965G(i915) || IS_I965GM(i915))
mask_size = 32;
- ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(mask_size));
+ ret = dma_set_coherent_mask(i915->drm.dev, DMA_BIT_MASK(mask_size));
if (ret)
goto mask_err;
@@ -510,7 +509,7 @@ static int i915_set_dma_info(struct drm_i915_private *i915)
*/
static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)
{
- struct pci_dev *pdev = dev_priv->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
int ret;
if (i915_inject_probe_failure(dev_priv))
@@ -639,7 +638,7 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)
*/
static void i915_driver_hw_remove(struct drm_i915_private *dev_priv)
{
- struct pci_dev *pdev = dev_priv->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
i915_perf_fini(dev_priv);
@@ -788,7 +787,6 @@ i915_driver_create(struct pci_dev *pdev, const struct pci_device_id *ent)
if (IS_ERR(i915))
return i915;
- i915->drm.pdev = pdev;
pci_set_drvdata(pdev, i915);
/* Device parameters start as a copy of module parameters. */
@@ -1088,7 +1086,7 @@ static int i915_drm_prepare(struct drm_device *dev)
static int i915_drm_suspend(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = to_i915(dev);
- struct pci_dev *pdev = dev_priv->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
pci_power_t opregion_target_state;
disable_rpm_wakeref_asserts(&dev_priv->runtime_pm);
@@ -1145,7 +1143,7 @@ get_suspend_mode(struct drm_i915_private *dev_priv, bool hibernate)
static int i915_drm_suspend_late(struct drm_device *dev, bool hibernation)
{
struct drm_i915_private *dev_priv = to_i915(dev);
- struct pci_dev *pdev = dev_priv->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
struct intel_runtime_pm *rpm = &dev_priv->runtime_pm;
int ret;
@@ -1275,7 +1273,7 @@ static int i915_drm_resume(struct drm_device *dev)
static int i915_drm_resume_early(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = to_i915(dev);
- struct pci_dev *pdev = dev_priv->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
int ret;
/*
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 5e5bcef20e33..b0e57ffb7527 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1289,7 +1289,7 @@ static inline struct drm_i915_private *pdev_to_i915(struct pci_dev *pdev)
#define INTEL_DEVID(dev_priv) (RUNTIME_INFO(dev_priv)->device_id)
#define REVID_FOREVER 0xff
-#define INTEL_REVID(dev_priv) ((dev_priv)->drm.pdev->revision)
+#define INTEL_REVID(dev_priv) (to_pci_dev((dev_priv)->drm.dev)->revision)
#define INTEL_GEN_MASK(s, e) ( \
BUILD_BUG_ON_ZERO(!__builtin_constant_p(s)) + \
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 3ee2f682eff6..486c9953e5b6 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -28,7 +28,7 @@ int i915_gem_gtt_prepare_pages(struct drm_i915_gem_object *obj,
struct sg_table *pages)
{
do {
- if (dma_map_sg_attrs(&obj->base.dev->pdev->dev,
+ if (dma_map_sg_attrs(obj->base.dev->dev,
pages->sgl, pages->nents,
PCI_DMA_BIDIRECTIONAL,
DMA_ATTR_SKIP_CPU_SYNC |
@@ -63,8 +63,7 @@ void i915_gem_gtt_finish_pages(struct drm_i915_gem_object *obj,
/* Wait a bit, in the hope it avoids the hang */
usleep_range(100, 250);
- dma_unmap_sg(&i915->drm.pdev->dev,
- pages->sgl, pages->nents,
+ dma_unmap_sg(i915->drm.dev, pages->sgl, pages->nents,
PCI_DMA_BIDIRECTIONAL);
}
diff --git a/drivers/gpu/drm/i915/i915_getparam.c b/drivers/gpu/drm/i915/i915_getparam.c
index 75c3bfc2486e..24e18219eb50 100644
--- a/drivers/gpu/drm/i915/i915_getparam.c
+++ b/drivers/gpu/drm/i915/i915_getparam.c
@@ -12,6 +12,7 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
struct drm_i915_private *i915 = to_i915(dev);
+ struct pci_dev *pdev = to_pci_dev(dev->dev);
const struct sseu_dev_info *sseu = &i915->gt.info.sseu;
drm_i915_getparam_t *param = data;
int value;
@@ -24,10 +25,10 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data,
/* Reject all old ums/dri params. */
return -ENODEV;
case I915_PARAM_CHIPSET_ID:
- value = i915->drm.pdev->device;
+ value = pdev->device;
break;
case I915_PARAM_REVISION:
- value = i915->drm.pdev->revision;
+ value = pdev->revision;
break;
case I915_PARAM_NUM_FENCES_AVAIL:
value = i915->ggtt.num_fences;
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index 8b163ee1b86d..e3068ce50b42 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -644,7 +644,7 @@ static void err_print_params(struct drm_i915_error_state_buf *m,
static void err_print_pciid(struct drm_i915_error_state_buf *m,
struct drm_i915_private *i915)
{
- struct pci_dev *pdev = i915->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
err_printf(m, "PCI ID: 0x%04x\n", pdev->device);
err_printf(m, "PCI Revision: 0x%02x\n", pdev->revision);
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index dd1971040bbc..5f062657280f 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -4378,7 +4378,7 @@ static void intel_irq_postinstall(struct drm_i915_private *dev_priv)
*/
int intel_irq_install(struct drm_i915_private *dev_priv)
{
- int irq = dev_priv->drm.pdev->irq;
+ int irq = to_pci_dev(dev_priv->drm.dev)->irq;
int ret;
/*
@@ -4413,7 +4413,7 @@ int intel_irq_install(struct drm_i915_private *dev_priv)
*/
void intel_irq_uninstall(struct drm_i915_private *dev_priv)
{
- int irq = dev_priv->drm.pdev->irq;
+ int irq = to_pci_dev(dev_priv->drm.dev)->irq;
/*
* FIXME we can get called twice during driver probe
@@ -4473,5 +4473,5 @@ bool intel_irqs_enabled(struct drm_i915_private *dev_priv)
void intel_synchronize_irq(struct drm_i915_private *i915)
{
- synchronize_irq(i915->drm.pdev->irq);
+ synchronize_irq(to_pci_dev(i915->drm.dev)->irq);
}
diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c
index 2b88c0baa1bf..41651ac255fa 100644
--- a/drivers/gpu/drm/i915/i915_pmu.c
+++ b/drivers/gpu/drm/i915/i915_pmu.c
@@ -1124,7 +1124,7 @@ static void i915_pmu_unregister_cpuhp_state(struct i915_pmu *pmu)
static bool is_igp(struct drm_i915_private *i915)
{
- struct pci_dev *pdev = i915->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
/* IGP is 0000:00:02.0 */
return pci_domain_nr(pdev->bus) == 0 &&
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
index 63212df33c9e..0bc7b49f843c 100644
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -85,7 +85,7 @@ static void intel_restore_swf(struct drm_i915_private *dev_priv)
void i915_save_display(struct drm_i915_private *dev_priv)
{
- struct pci_dev *pdev = dev_priv->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
/* Display arbitration control */
if (INTEL_GEN(dev_priv) <= 4)
@@ -100,7 +100,7 @@ void i915_save_display(struct drm_i915_private *dev_priv)
void i915_restore_display(struct drm_i915_private *dev_priv)
{
- struct pci_dev *pdev = dev_priv->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
intel_restore_swf(dev_priv);
diff --git a/drivers/gpu/drm/i915/i915_switcheroo.c b/drivers/gpu/drm/i915/i915_switcheroo.c
index b3a24eac21f1..de0e224b56ce 100644
--- a/drivers/gpu/drm/i915/i915_switcheroo.c
+++ b/drivers/gpu/drm/i915/i915_switcheroo.c
@@ -54,14 +54,14 @@ static const struct vga_switcheroo_client_ops i915_switcheroo_ops = {
int i915_switcheroo_register(struct drm_i915_private *i915)
{
- struct pci_dev *pdev = i915->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
return vga_switcheroo_register_client(pdev, &i915_switcheroo_ops, false);
}
void i915_switcheroo_unregister(struct drm_i915_private *i915)
{
- struct pci_dev *pdev = i915->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
vga_switcheroo_unregister_client(pdev);
}
diff --git a/drivers/gpu/drm/i915/i915_vgpu.c b/drivers/gpu/drm/i915/i915_vgpu.c
index 70fca72f5162..172799277dd5 100644
--- a/drivers/gpu/drm/i915/i915_vgpu.c
+++ b/drivers/gpu/drm/i915/i915_vgpu.c
@@ -61,7 +61,7 @@
*/
void intel_vgpu_detect(struct drm_i915_private *dev_priv)
{
- struct pci_dev *pdev = dev_priv->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
u64 magic;
u16 version_major;
void __iomem *shared_area;
diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c
index f2d5ae59081e..fda350f51dd0 100644
--- a/drivers/gpu/drm/i915/intel_device_info.c
+++ b/drivers/gpu/drm/i915/intel_device_info.c
@@ -204,7 +204,7 @@ void intel_device_info_subplatform_init(struct drm_i915_private *i915)
}
if (IS_TIGERLAKE(i915)) {
- struct pci_dev *root, *pdev = i915->drm.pdev;
+ struct pci_dev *root, *pdev = to_pci_dev(i915->drm.dev);
root = list_first_entry(&pdev->bus->devices, typeof(*root), bus_list);
diff --git a/drivers/gpu/drm/i915/intel_region_lmem.c b/drivers/gpu/drm/i915/intel_region_lmem.c
index 40d8f1a95df6..0fe49b3adade 100644
--- a/drivers/gpu/drm/i915/intel_region_lmem.c
+++ b/drivers/gpu/drm/i915/intel_region_lmem.c
@@ -26,12 +26,12 @@ static int init_fake_lmem_bar(struct intel_memory_region *mem)
if (ret)
return ret;
- mem->remap_addr = dma_map_resource(&i915->drm.pdev->dev,
+ mem->remap_addr = dma_map_resource(i915->drm.dev,
mem->region.start,
mem->fake_mappable.size,
PCI_DMA_BIDIRECTIONAL,
DMA_ATTR_FORCE_CONTIGUOUS);
- if (dma_mapping_error(&i915->drm.pdev->dev, mem->remap_addr)) {
+ if (dma_mapping_error(i915->drm.dev, mem->remap_addr)) {
drm_mm_remove_node(&mem->fake_mappable);
return -EINVAL;
}
@@ -56,7 +56,7 @@ static void release_fake_lmem_bar(struct intel_memory_region *mem)
drm_mm_remove_node(&mem->fake_mappable);
- dma_unmap_resource(&mem->i915->drm.pdev->dev,
+ dma_unmap_resource(mem->i915->drm.dev,
mem->remap_addr,
mem->fake_mappable.size,
PCI_DMA_BIDIRECTIONAL,
@@ -104,7 +104,7 @@ const struct intel_memory_region_ops intel_region_lmem_ops = {
struct intel_memory_region *
intel_setup_fake_lmem(struct drm_i915_private *i915)
{
- struct pci_dev *pdev = i915->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
struct intel_memory_region *mem;
resource_size_t mappable_end;
resource_size_t io_start;
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index 153ca9e65382..4970ef0843dc 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -625,7 +625,7 @@ void intel_runtime_pm_init_early(struct intel_runtime_pm *rpm)
{
struct drm_i915_private *i915 =
container_of(rpm, struct drm_i915_private, runtime_pm);
- struct pci_dev *pdev = i915->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
struct device *kdev = &pdev->dev;
rpm->kdev = kdev;
diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 9ac501bcfdad..5098f95d71b0 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -1780,7 +1780,7 @@ static int i915_pmic_bus_access_notifier(struct notifier_block *nb,
static int uncore_mmio_setup(struct intel_uncore *uncore)
{
struct drm_i915_private *i915 = uncore->i915;
- struct pci_dev *pdev = i915->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
int mmio_bar;
int mmio_size;
@@ -1812,7 +1812,7 @@ static int uncore_mmio_setup(struct intel_uncore *uncore)
static void uncore_mmio_cleanup(struct intel_uncore *uncore)
{
- struct pci_dev *pdev = uncore->i915->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(uncore->i915->drm.dev);
pci_iounmap(pdev, uncore->regs);
}
diff --git a/drivers/gpu/drm/i915/selftests/mock_gem_device.c b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
index 0188f877cab2..2a07a008de2e 100644
--- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c
+++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c
@@ -146,7 +146,6 @@ struct drm_i915_private *mock_gem_device(void)
}
pci_set_drvdata(pdev, i915);
- i915->drm.pdev = pdev;
dev_pm_domain_set(&pdev->dev, &pm_domain);
pm_runtime_enable(&pdev->dev);
diff --git a/drivers/gpu/drm/i915/selftests/mock_gtt.c b/drivers/gpu/drm/i915/selftests/mock_gtt.c
index 7270fc8ca801..5c7ae40bba63 100644
--- a/drivers/gpu/drm/i915/selftests/mock_gtt.c
+++ b/drivers/gpu/drm/i915/selftests/mock_gtt.c
@@ -74,7 +74,7 @@ struct i915_ppgtt *mock_ppgtt(struct drm_i915_private *i915, const char *name)
ppgtt->vm.i915 = i915;
ppgtt->vm.total = round_down(U64_MAX, PAGE_SIZE);
ppgtt->vm.file = ERR_PTR(-ENODEV);
- ppgtt->vm.dma = &i915->drm.pdev->dev;
+ ppgtt->vm.dma = i915->drm.dev;
i915_address_space_init(&ppgtt->vm, VM_CLASS_PPGTT);
--
2.29.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [Intel-gfx] [PATCH v3 5/8] drm/i915/gt: Remove references to struct drm_device.pdev
2021-01-07 8:07 [Intel-gfx] [PATCH v3 0/8] drm: Move struct drm_device.pdev to legacy Thomas Zimmermann
` (3 preceding siblings ...)
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 4/8] drm/i915: " Thomas Zimmermann
@ 2021-01-07 8:07 ` Thomas Zimmermann
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 6/8] drm/i915/gvt: " Thomas Zimmermann
` (3 subsequent siblings)
8 siblings, 0 replies; 20+ messages in thread
From: Thomas Zimmermann @ 2021-01-07 8:07 UTC (permalink / raw)
To: airlied, daniel, jani.nikula, joonas.lahtinen, rodrigo.vivi
Cc: nouveau, intel-gfx, dri-devel, amd-gfx, Thomas Zimmermann, intel-gvt-dev
Using struct drm_device.pdev is deprecated. Convert i915 to struct
drm_device.dev. No functional changes.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
drivers/gpu/drm/i915/gt/intel_engine_cs.c | 2 +-
drivers/gpu/drm/i915/gt/intel_ggtt.c | 10 +++++-----
drivers/gpu/drm/i915/gt/intel_ppgtt.c | 2 +-
drivers/gpu/drm/i915/gt/intel_rc6.c | 4 ++--
drivers/gpu/drm/i915/gt/intel_reset.c | 6 +++---
5 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
index 1847d3c2ea99..a1e872ecc3f1 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
@@ -1252,7 +1252,7 @@ bool intel_engine_is_idle(struct intel_engine_cs *engine)
/* Waiting to drain ELSP? */
if (execlists_active(&engine->execlists)) {
- synchronize_hardirq(engine->i915->drm.pdev->irq);
+ synchronize_hardirq(to_pci_dev(engine->i915->drm.dev)->irq);
intel_engine_flush_submission(engine);
diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt.c b/drivers/gpu/drm/i915/gt/intel_ggtt.c
index eece0844fbe9..fd6c8fa54812 100644
--- a/drivers/gpu/drm/i915/gt/intel_ggtt.c
+++ b/drivers/gpu/drm/i915/gt/intel_ggtt.c
@@ -769,7 +769,7 @@ static unsigned int chv_get_total_gtt_size(u16 gmch_ctrl)
static int ggtt_probe_common(struct i915_ggtt *ggtt, u64 size)
{
struct drm_i915_private *i915 = ggtt->vm.i915;
- struct pci_dev *pdev = i915->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
phys_addr_t phys_addr;
int ret;
@@ -839,7 +839,7 @@ static struct resource pci_resource(struct pci_dev *pdev, int bar)
static int gen8_gmch_probe(struct i915_ggtt *ggtt)
{
struct drm_i915_private *i915 = ggtt->vm.i915;
- struct pci_dev *pdev = i915->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
unsigned int size;
u16 snb_gmch_ctl;
@@ -983,7 +983,7 @@ static u64 iris_pte_encode(dma_addr_t addr,
static int gen6_gmch_probe(struct i915_ggtt *ggtt)
{
struct drm_i915_private *i915 = ggtt->vm.i915;
- struct pci_dev *pdev = i915->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
unsigned int size;
u16 snb_gmch_ctl;
@@ -1046,7 +1046,7 @@ static int i915_gmch_probe(struct i915_ggtt *ggtt)
phys_addr_t gmadr_base;
int ret;
- ret = intel_gmch_probe(i915->bridge_dev, i915->drm.pdev, NULL);
+ ret = intel_gmch_probe(i915->bridge_dev, to_pci_dev(i915->drm.dev), NULL);
if (!ret) {
drm_err(&i915->drm, "failed to set up gmch\n");
return -EIO;
@@ -1091,7 +1091,7 @@ static int ggtt_probe_hw(struct i915_ggtt *ggtt, struct intel_gt *gt)
ggtt->vm.gt = gt;
ggtt->vm.i915 = i915;
- ggtt->vm.dma = &i915->drm.pdev->dev;
+ ggtt->vm.dma = i915->drm.dev;
if (INTEL_GEN(i915) <= 5)
ret = i915_gmch_probe(ggtt);
diff --git a/drivers/gpu/drm/i915/gt/intel_ppgtt.c b/drivers/gpu/drm/i915/gt/intel_ppgtt.c
index 46d9aceda64c..01b7d08532f2 100644
--- a/drivers/gpu/drm/i915/gt/intel_ppgtt.c
+++ b/drivers/gpu/drm/i915/gt/intel_ppgtt.c
@@ -301,7 +301,7 @@ void ppgtt_init(struct i915_ppgtt *ppgtt, struct intel_gt *gt)
ppgtt->vm.gt = gt;
ppgtt->vm.i915 = i915;
- ppgtt->vm.dma = &i915->drm.pdev->dev;
+ ppgtt->vm.dma = i915->drm.dev;
ppgtt->vm.total = BIT_ULL(INTEL_INFO(i915)->ppgtt_size);
i915_address_space_init(&ppgtt->vm, VM_CLASS_PPGTT);
diff --git a/drivers/gpu/drm/i915/gt/intel_rc6.c b/drivers/gpu/drm/i915/gt/intel_rc6.c
index d7b8e4457fc2..cce53fb9589c 100644
--- a/drivers/gpu/drm/i915/gt/intel_rc6.c
+++ b/drivers/gpu/drm/i915/gt/intel_rc6.c
@@ -485,14 +485,14 @@ static bool rc6_supported(struct intel_rc6 *rc6)
static void rpm_get(struct intel_rc6 *rc6)
{
GEM_BUG_ON(rc6->wakeref);
- pm_runtime_get_sync(&rc6_to_i915(rc6)->drm.pdev->dev);
+ pm_runtime_get_sync(rc6_to_i915(rc6)->drm.dev);
rc6->wakeref = true;
}
static void rpm_put(struct intel_rc6 *rc6)
{
GEM_BUG_ON(!rc6->wakeref);
- pm_runtime_put(&rc6_to_i915(rc6)->drm.pdev->dev);
+ pm_runtime_put(rc6_to_i915(rc6)->drm.dev);
rc6->wakeref = false;
}
diff --git a/drivers/gpu/drm/i915/gt/intel_reset.c b/drivers/gpu/drm/i915/gt/intel_reset.c
index 761b50eca33b..fa8f1e98dd0a 100644
--- a/drivers/gpu/drm/i915/gt/intel_reset.c
+++ b/drivers/gpu/drm/i915/gt/intel_reset.c
@@ -179,7 +179,7 @@ static int i915_do_reset(struct intel_gt *gt,
intel_engine_mask_t engine_mask,
unsigned int retry)
{
- struct pci_dev *pdev = gt->i915->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(gt->i915->drm.dev);
int err;
/* Assert reset for at least 20 usec, and wait for acknowledgement. */
@@ -208,7 +208,7 @@ static int g33_do_reset(struct intel_gt *gt,
intel_engine_mask_t engine_mask,
unsigned int retry)
{
- struct pci_dev *pdev = gt->i915->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(gt->i915->drm.dev);
pci_write_config_byte(pdev, I915_GDRST, GRDOM_RESET_ENABLE);
return wait_for_atomic(g4x_reset_complete(pdev), 50);
@@ -218,7 +218,7 @@ static int g4x_do_reset(struct intel_gt *gt,
intel_engine_mask_t engine_mask,
unsigned int retry)
{
- struct pci_dev *pdev = gt->i915->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(gt->i915->drm.dev);
struct intel_uncore *uncore = gt->uncore;
int ret;
--
2.29.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [Intel-gfx] [PATCH v3 6/8] drm/i915/gvt: Remove references to struct drm_device.pdev
2021-01-07 8:07 [Intel-gfx] [PATCH v3 0/8] drm: Move struct drm_device.pdev to legacy Thomas Zimmermann
` (4 preceding siblings ...)
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 5/8] drm/i915/gt: " Thomas Zimmermann
@ 2021-01-07 8:07 ` Thomas Zimmermann
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 7/8] drm/nouveau: " Thomas Zimmermann
` (2 subsequent siblings)
8 siblings, 0 replies; 20+ messages in thread
From: Thomas Zimmermann @ 2021-01-07 8:07 UTC (permalink / raw)
To: airlied, daniel, jani.nikula, joonas.lahtinen, rodrigo.vivi
Cc: nouveau, intel-gfx, dri-devel, amd-gfx, Thomas Zimmermann, intel-gvt-dev
Using struct drm_device.pdev is deprecated. Convert i915 to struct
drm_device.dev. No functional changes.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
drivers/gpu/drm/i915/gvt/cfg_space.c | 5 +++--
drivers/gpu/drm/i915/gvt/firmware.c | 10 +++++-----
drivers/gpu/drm/i915/gvt/gtt.c | 12 ++++++------
drivers/gpu/drm/i915/gvt/gvt.c | 6 +++---
drivers/gpu/drm/i915/gvt/kvmgt.c | 4 ++--
5 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/drivers/gpu/drm/i915/gvt/cfg_space.c b/drivers/gpu/drm/i915/gvt/cfg_space.c
index ad86c5eb5bba..b490e3db2e38 100644
--- a/drivers/gpu/drm/i915/gvt/cfg_space.c
+++ b/drivers/gpu/drm/i915/gvt/cfg_space.c
@@ -374,6 +374,7 @@ void intel_vgpu_init_cfg_space(struct intel_vgpu *vgpu,
bool primary)
{
struct intel_gvt *gvt = vgpu->gvt;
+ struct pci_dev *pdev = to_pci_dev(gvt->gt->i915->drm.dev);
const struct intel_gvt_device_info *info = &gvt->device_info;
u16 *gmch_ctl;
u8 next;
@@ -407,9 +408,9 @@ void intel_vgpu_init_cfg_space(struct intel_vgpu *vgpu,
memset(vgpu_cfg_space(vgpu) + INTEL_GVT_PCI_OPREGION, 0, 4);
vgpu->cfg_space.bar[INTEL_GVT_PCI_BAR_GTTMMIO].size =
- pci_resource_len(gvt->gt->i915->drm.pdev, 0);
+ pci_resource_len(pdev, 0);
vgpu->cfg_space.bar[INTEL_GVT_PCI_BAR_APERTURE].size =
- pci_resource_len(gvt->gt->i915->drm.pdev, 2);
+ pci_resource_len(pdev, 2);
memset(vgpu_cfg_space(vgpu) + PCI_ROM_ADDRESS, 0, 4);
diff --git a/drivers/gpu/drm/i915/gvt/firmware.c b/drivers/gpu/drm/i915/gvt/firmware.c
index 990a181094e3..1a8274a3f4b1 100644
--- a/drivers/gpu/drm/i915/gvt/firmware.c
+++ b/drivers/gpu/drm/i915/gvt/firmware.c
@@ -76,7 +76,7 @@ static int mmio_snapshot_handler(struct intel_gvt *gvt, u32 offset, void *data)
static int expose_firmware_sysfs(struct intel_gvt *gvt)
{
struct intel_gvt_device_info *info = &gvt->device_info;
- struct pci_dev *pdev = gvt->gt->i915->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(gvt->gt->i915->drm.dev);
struct gvt_firmware_header *h;
void *firmware;
void *p;
@@ -127,7 +127,7 @@ static int expose_firmware_sysfs(struct intel_gvt *gvt)
static void clean_firmware_sysfs(struct intel_gvt *gvt)
{
- struct pci_dev *pdev = gvt->gt->i915->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(gvt->gt->i915->drm.dev);
device_remove_bin_file(&pdev->dev, &firmware_attr);
vfree(firmware_attr.private);
@@ -151,7 +151,7 @@ static int verify_firmware(struct intel_gvt *gvt,
const struct firmware *fw)
{
struct intel_gvt_device_info *info = &gvt->device_info;
- struct pci_dev *pdev = gvt->gt->i915->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(gvt->gt->i915->drm.dev);
struct gvt_firmware_header *h;
unsigned long id, crc32_start;
const void *mem;
@@ -205,7 +205,7 @@ static int verify_firmware(struct intel_gvt *gvt,
int intel_gvt_load_firmware(struct intel_gvt *gvt)
{
struct intel_gvt_device_info *info = &gvt->device_info;
- struct pci_dev *pdev = gvt->gt->i915->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(gvt->gt->i915->drm.dev);
struct intel_gvt_firmware *firmware = &gvt->firmware;
struct gvt_firmware_header *h;
const struct firmware *fw;
@@ -240,7 +240,7 @@ int intel_gvt_load_firmware(struct intel_gvt *gvt)
gvt_dbg_core("request hw state firmware %s...\n", path);
- ret = request_firmware(&fw, path, &gvt->gt->i915->drm.pdev->dev);
+ ret = request_firmware(&fw, path, gvt->gt->i915->drm.dev);
kfree(path);
if (ret)
diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i915/gvt/gtt.c
index 897c007ea96a..6d12a5a401f6 100644
--- a/drivers/gpu/drm/i915/gvt/gtt.c
+++ b/drivers/gpu/drm/i915/gvt/gtt.c
@@ -746,7 +746,7 @@ static int detach_oos_page(struct intel_vgpu *vgpu,
static void ppgtt_free_spt(struct intel_vgpu_ppgtt_spt *spt)
{
- struct device *kdev = &spt->vgpu->gvt->gt->i915->drm.pdev->dev;
+ struct device *kdev = spt->vgpu->gvt->gt->i915->drm.dev;
trace_spt_free(spt->vgpu->id, spt, spt->guest_page.type);
@@ -831,7 +831,7 @@ static int reclaim_one_ppgtt_mm(struct intel_gvt *gvt);
static struct intel_vgpu_ppgtt_spt *ppgtt_alloc_spt(
struct intel_vgpu *vgpu, enum intel_gvt_gtt_type type)
{
- struct device *kdev = &vgpu->gvt->gt->i915->drm.pdev->dev;
+ struct device *kdev = vgpu->gvt->gt->i915->drm.dev;
struct intel_vgpu_ppgtt_spt *spt = NULL;
dma_addr_t daddr;
int ret;
@@ -2402,7 +2402,7 @@ static int alloc_scratch_pages(struct intel_vgpu *vgpu,
vgpu->gvt->device_info.gtt_entry_size_shift;
void *scratch_pt;
int i;
- struct device *dev = &vgpu->gvt->gt->i915->drm.pdev->dev;
+ struct device *dev = vgpu->gvt->gt->i915->drm.dev;
dma_addr_t daddr;
if (drm_WARN_ON(&i915->drm,
@@ -2460,7 +2460,7 @@ static int alloc_scratch_pages(struct intel_vgpu *vgpu,
static int release_scratch_page_tree(struct intel_vgpu *vgpu)
{
int i;
- struct device *dev = &vgpu->gvt->gt->i915->drm.pdev->dev;
+ struct device *dev = vgpu->gvt->gt->i915->drm.dev;
dma_addr_t daddr;
for (i = GTT_TYPE_PPGTT_PTE_PT; i < GTT_TYPE_MAX; i++) {
@@ -2732,7 +2732,7 @@ int intel_gvt_init_gtt(struct intel_gvt *gvt)
{
int ret;
void *page;
- struct device *dev = &gvt->gt->i915->drm.pdev->dev;
+ struct device *dev = gvt->gt->i915->drm.dev;
dma_addr_t daddr;
gvt_dbg_core("init gtt\n");
@@ -2781,7 +2781,7 @@ int intel_gvt_init_gtt(struct intel_gvt *gvt)
*/
void intel_gvt_clean_gtt(struct intel_gvt *gvt)
{
- struct device *dev = &gvt->gt->i915->drm.pdev->dev;
+ struct device *dev = gvt->gt->i915->drm.dev;
dma_addr_t daddr = (dma_addr_t)(gvt->gtt.scratch_mfn <<
I915_GTT_PAGE_SHIFT);
diff --git a/drivers/gpu/drm/i915/gvt/gvt.c b/drivers/gpu/drm/i915/gvt/gvt.c
index d1d8ee4a5f16..aa7fc0dd1db5 100644
--- a/drivers/gpu/drm/i915/gvt/gvt.c
+++ b/drivers/gpu/drm/i915/gvt/gvt.c
@@ -50,7 +50,7 @@ static struct intel_vgpu_type *intel_gvt_find_vgpu_type(struct intel_gvt *gvt,
const char *name)
{
const char *driver_name =
- dev_driver_string(&gvt->gt->i915->drm.pdev->dev);
+ dev_driver_string(gvt->gt->i915->drm.dev);
int i;
name += strlen(driver_name) + 1;
@@ -189,7 +189,7 @@ static const struct intel_gvt_ops intel_gvt_ops = {
static void init_device_info(struct intel_gvt *gvt)
{
struct intel_gvt_device_info *info = &gvt->device_info;
- struct pci_dev *pdev = gvt->gt->i915->drm.pdev;
+ struct pci_dev *pdev = to_pci_dev(gvt->gt->i915->drm.dev);
info->max_support_vgpus = 8;
info->cfg_space_size = PCI_CFG_SPACE_EXP_SIZE;
@@ -376,7 +376,7 @@ int intel_gvt_init_device(struct drm_i915_private *i915)
intel_gvt_debugfs_init(gvt);
gvt_dbg_core("gvt device initialization is done\n");
- intel_gvt_host.dev = &i915->drm.pdev->dev;
+ intel_gvt_host.dev = i915->drm.dev;
intel_gvt_host.initialized = true;
return 0;
diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c
index 60f1a386dd06..551f00024e99 100644
--- a/drivers/gpu/drm/i915/gvt/kvmgt.c
+++ b/drivers/gpu/drm/i915/gvt/kvmgt.c
@@ -221,7 +221,7 @@ static int gvt_pin_guest_page(struct intel_vgpu *vgpu, unsigned long gfn,
static int gvt_dma_map_page(struct intel_vgpu *vgpu, unsigned long gfn,
dma_addr_t *dma_addr, unsigned long size)
{
- struct device *dev = &vgpu->gvt->gt->i915->drm.pdev->dev;
+ struct device *dev = vgpu->gvt->gt->i915->drm.dev;
struct page *page = NULL;
int ret;
@@ -244,7 +244,7 @@ static int gvt_dma_map_page(struct intel_vgpu *vgpu, unsigned long gfn,
static void gvt_dma_unmap_page(struct intel_vgpu *vgpu, unsigned long gfn,
dma_addr_t dma_addr, unsigned long size)
{
- struct device *dev = &vgpu->gvt->gt->i915->drm.pdev->dev;
+ struct device *dev = vgpu->gvt->gt->i915->drm.dev;
dma_unmap_page(dev, dma_addr, size, PCI_DMA_BIDIRECTIONAL);
gvt_unpin_guest_page(vgpu, gfn, size);
--
2.29.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [Intel-gfx] [PATCH v3 7/8] drm/nouveau: Remove references to struct drm_device.pdev
2021-01-07 8:07 [Intel-gfx] [PATCH v3 0/8] drm: Move struct drm_device.pdev to legacy Thomas Zimmermann
` (5 preceding siblings ...)
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 6/8] drm/i915/gvt: " Thomas Zimmermann
@ 2021-01-07 8:07 ` Thomas Zimmermann
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 8/8] drm: Upcast struct drm_device.dev to struct pci_device; replace pdev Thomas Zimmermann
2021-01-07 15:33 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm: Move struct drm_device.pdev to legacy (rev3) Patchwork
8 siblings, 0 replies; 20+ messages in thread
From: Thomas Zimmermann @ 2021-01-07 8:07 UTC (permalink / raw)
To: airlied, daniel, jani.nikula, joonas.lahtinen, rodrigo.vivi
Cc: nouveau, intel-gfx, dri-devel, Jeremy Cline, amd-gfx,
Thomas Zimmermann, intel-gvt-dev, Ben Skeggs
Using struct drm_device.pdev is deprecated. Convert nouveau to struct
drm_device.dev. No functional changes.
v3:
* fix nv04_dfp_update_backlight() as well (Jeremy)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jeremy Cline <jcline@redhat.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
---
drivers/gpu/drm/nouveau/dispnv04/arb.c | 12 +++++++-----
drivers/gpu/drm/nouveau/dispnv04/dfp.c | 5 +++--
drivers/gpu/drm/nouveau/dispnv04/disp.h | 14 ++++++++------
drivers/gpu/drm/nouveau/dispnv04/hw.c | 10 ++++++----
drivers/gpu/drm/nouveau/nouveau_abi16.c | 7 ++++---
drivers/gpu/drm/nouveau/nouveau_acpi.c | 2 +-
drivers/gpu/drm/nouveau/nouveau_bios.c | 11 ++++++++---
drivers/gpu/drm/nouveau/nouveau_connector.c | 10 ++++++----
drivers/gpu/drm/nouveau/nouveau_drm.c | 5 ++---
drivers/gpu/drm/nouveau/nouveau_fbcon.c | 6 ++++--
drivers/gpu/drm/nouveau/nouveau_vga.c | 20 ++++++++++++--------
11 files changed, 61 insertions(+), 41 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/dispnv04/arb.c b/drivers/gpu/drm/nouveau/dispnv04/arb.c
index 9d4a2d97507e..1d3542d6006b 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/arb.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/arb.c
@@ -200,16 +200,17 @@ nv04_update_arb(struct drm_device *dev, int VClk, int bpp,
int MClk = nouveau_hw_get_clock(dev, PLL_MEMORY);
int NVClk = nouveau_hw_get_clock(dev, PLL_CORE);
uint32_t cfg1 = nvif_rd32(device, NV04_PFB_CFG1);
+ struct pci_dev *pdev = to_pci_dev(dev->dev);
sim_data.pclk_khz = VClk;
sim_data.mclk_khz = MClk;
sim_data.nvclk_khz = NVClk;
sim_data.bpp = bpp;
sim_data.two_heads = nv_two_heads(dev);
- if ((dev->pdev->device & 0xffff) == 0x01a0 /*CHIPSET_NFORCE*/ ||
- (dev->pdev->device & 0xffff) == 0x01f0 /*CHIPSET_NFORCE2*/) {
+ if ((pdev->device & 0xffff) == 0x01a0 /*CHIPSET_NFORCE*/ ||
+ (pdev->device & 0xffff) == 0x01f0 /*CHIPSET_NFORCE2*/) {
uint32_t type;
- int domain = pci_domain_nr(dev->pdev->bus);
+ int domain = pci_domain_nr(pdev->bus);
pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 1),
0x7c, &type);
@@ -251,11 +252,12 @@ void
nouveau_calc_arb(struct drm_device *dev, int vclk, int bpp, int *burst, int *lwm)
{
struct nouveau_drm *drm = nouveau_drm(dev);
+ struct pci_dev *pdev = to_pci_dev(dev->dev);
if (drm->client.device.info.family < NV_DEVICE_INFO_V0_KELVIN)
nv04_update_arb(dev, vclk, bpp, burst, lwm);
- else if ((dev->pdev->device & 0xfff0) == 0x0240 /*CHIPSET_C51*/ ||
- (dev->pdev->device & 0xfff0) == 0x03d0 /*CHIPSET_C512*/) {
+ else if ((pdev->device & 0xfff0) == 0x0240 /*CHIPSET_C51*/ ||
+ (pdev->device & 0xfff0) == 0x03d0 /*CHIPSET_C512*/) {
*burst = 128;
*lwm = 0x0480;
} else
diff --git a/drivers/gpu/drm/nouveau/dispnv04/dfp.c b/drivers/gpu/drm/nouveau/dispnv04/dfp.c
index 42687ea2a4ca..ce3d8c6ef000 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/dfp.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/dfp.c
@@ -488,12 +488,13 @@ static void nv04_dfp_update_backlight(struct drm_encoder *encoder, int mode)
#ifdef __powerpc__
struct drm_device *dev = encoder->dev;
struct nvif_object *device = &nouveau_drm(dev)->client.device.object;
+ struct pci_dev *pdev = to_pci_dev(dev->dev);
/* BIOS scripts usually take care of the backlight, thanks
* Apple for your consistency.
*/
- if (dev->pdev->device == 0x0174 || dev->pdev->device == 0x0179 ||
- dev->pdev->device == 0x0189 || dev->pdev->device == 0x0329) {
+ if (pdev->device == 0x0174 || pdev->device == 0x0179 ||
+ pdev->device == 0x0189 || pdev->device == 0x0329) {
if (mode == DRM_MODE_DPMS_ON) {
nvif_mask(device, NV_PBUS_DEBUG_DUALHEAD_CTL, 1 << 31, 1 << 31);
nvif_mask(device, NV_PCRTC_GPIO_EXT, 3, 1);
diff --git a/drivers/gpu/drm/nouveau/dispnv04/disp.h b/drivers/gpu/drm/nouveau/dispnv04/disp.h
index 5ace5e906949..f0a24126641a 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/disp.h
+++ b/drivers/gpu/drm/nouveau/dispnv04/disp.h
@@ -130,7 +130,7 @@ static inline bool
nv_two_heads(struct drm_device *dev)
{
struct nouveau_drm *drm = nouveau_drm(dev);
- const int impl = dev->pdev->device & 0x0ff0;
+ const int impl = to_pci_dev(dev->dev)->device & 0x0ff0;
if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_CELSIUS && impl != 0x0100 &&
impl != 0x0150 && impl != 0x01a0 && impl != 0x0200)
@@ -142,14 +142,14 @@ nv_two_heads(struct drm_device *dev)
static inline bool
nv_gf4_disp_arch(struct drm_device *dev)
{
- return nv_two_heads(dev) && (dev->pdev->device & 0x0ff0) != 0x0110;
+ return nv_two_heads(dev) && (to_pci_dev(dev->dev)->device & 0x0ff0) != 0x0110;
}
static inline bool
nv_two_reg_pll(struct drm_device *dev)
{
struct nouveau_drm *drm = nouveau_drm(dev);
- const int impl = dev->pdev->device & 0x0ff0;
+ const int impl = to_pci_dev(dev->dev)->device & 0x0ff0;
if (impl == 0x0310 || impl == 0x0340 || drm->client.device.info.family >= NV_DEVICE_INFO_V0_CURIE)
return true;
@@ -160,9 +160,11 @@ static inline bool
nv_match_device(struct drm_device *dev, unsigned device,
unsigned sub_vendor, unsigned sub_device)
{
- return dev->pdev->device == device &&
- dev->pdev->subsystem_vendor == sub_vendor &&
- dev->pdev->subsystem_device == sub_device;
+ struct pci_dev *pdev = to_pci_dev(dev->dev);
+
+ return pdev->device == device &&
+ pdev->subsystem_vendor == sub_vendor &&
+ pdev->subsystem_device == sub_device;
}
#include <subdev/bios/init.h>
diff --git a/drivers/gpu/drm/nouveau/dispnv04/hw.c b/drivers/gpu/drm/nouveau/dispnv04/hw.c
index b674d68ef28a..f7d35657aa64 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/hw.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/hw.c
@@ -214,14 +214,15 @@ nouveau_hw_pllvals_to_clk(struct nvkm_pll_vals *pv)
int
nouveau_hw_get_clock(struct drm_device *dev, enum nvbios_pll_type plltype)
{
+ struct pci_dev *pdev = to_pci_dev(dev->dev);
struct nvkm_pll_vals pllvals;
int ret;
int domain;
- domain = pci_domain_nr(dev->pdev->bus);
+ domain = pci_domain_nr(pdev->bus);
if (plltype == PLL_MEMORY &&
- (dev->pdev->device & 0x0ff0) == CHIPSET_NFORCE) {
+ (pdev->device & 0x0ff0) == CHIPSET_NFORCE) {
uint32_t mpllP;
pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 3),
0x6c, &mpllP);
@@ -232,7 +233,7 @@ nouveau_hw_get_clock(struct drm_device *dev, enum nvbios_pll_type plltype)
return 400000 / mpllP;
} else
if (plltype == PLL_MEMORY &&
- (dev->pdev->device & 0xff0) == CHIPSET_NFORCE2) {
+ (pdev->device & 0xff0) == CHIPSET_NFORCE2) {
uint32_t clock;
pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 5),
@@ -309,6 +310,7 @@ void
nouveau_hw_save_vga_fonts(struct drm_device *dev, bool save)
{
struct nouveau_drm *drm = nouveau_drm(dev);
+ struct pci_dev *pdev = to_pci_dev(dev->dev);
uint8_t misc, gr4, gr5, gr6, seq2, seq4;
bool graphicsmode;
unsigned plane;
@@ -327,7 +329,7 @@ nouveau_hw_save_vga_fonts(struct drm_device *dev, bool save)
NV_INFO(drm, "%sing VGA fonts\n", save ? "Sav" : "Restor");
/* map first 64KiB of VRAM, holds VGA fonts etc */
- iovram = ioremap(pci_resource_start(dev->pdev, 1), 65536);
+ iovram = ioremap(pci_resource_start(pdev, 1), 65536);
if (!iovram) {
NV_ERROR(drm, "Failed to map VRAM, "
"cannot save/restore VGA fonts.\n");
diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.c b/drivers/gpu/drm/nouveau/nouveau_abi16.c
index 9a5be6f32424..f08b31d84d4d 100644
--- a/drivers/gpu/drm/nouveau/nouveau_abi16.c
+++ b/drivers/gpu/drm/nouveau/nouveau_abi16.c
@@ -181,6 +181,7 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS)
struct nvif_device *device = &drm->client.device;
struct nvkm_gr *gr = nvxx_gr(device);
struct drm_nouveau_getparam *getparam = data;
+ struct pci_dev *pdev = to_pci_dev(dev->dev);
switch (getparam->param) {
case NOUVEAU_GETPARAM_CHIPSET_ID:
@@ -188,13 +189,13 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS)
break;
case NOUVEAU_GETPARAM_PCI_VENDOR:
if (device->info.platform != NV_DEVICE_INFO_V0_SOC)
- getparam->value = dev->pdev->vendor;
+ getparam->value = pdev->vendor;
else
getparam->value = 0;
break;
case NOUVEAU_GETPARAM_PCI_DEVICE:
if (device->info.platform != NV_DEVICE_INFO_V0_SOC)
- getparam->value = dev->pdev->device;
+ getparam->value = pdev->device;
else
getparam->value = 0;
break;
@@ -205,7 +206,7 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS)
case NV_DEVICE_INFO_V0_PCIE: getparam->value = 2; break;
case NV_DEVICE_INFO_V0_SOC : getparam->value = 3; break;
case NV_DEVICE_INFO_V0_IGP :
- if (!pci_is_pcie(dev->pdev))
+ if (!pci_is_pcie(pdev))
getparam->value = 1;
else
getparam->value = 2;
diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c
index 69a84d0197d0..7c15f6448428 100644
--- a/drivers/gpu/drm/nouveau/nouveau_acpi.c
+++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c
@@ -377,7 +377,7 @@ nouveau_acpi_edid(struct drm_device *dev, struct drm_connector *connector)
return NULL;
}
- handle = ACPI_HANDLE(&dev->pdev->dev);
+ handle = ACPI_HANDLE(dev->dev);
if (!handle)
return NULL;
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
index d204ea8a5618..7cc683b8dc7a 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
@@ -110,6 +110,9 @@ static int call_lvds_manufacturer_script(struct drm_device *dev, struct dcb_outp
struct nvbios *bios = &drm->vbios;
uint8_t sub = bios->data[bios->fp.xlated_entry + script] + (bios->fp.link_c_increment && dcbent->or & DCB_OUTPUT_C ? 1 : 0);
uint16_t scriptofs = ROM16(bios->data[bios->init_script_tbls_ptr + sub * 2]);
+#ifdef __powerpc__
+ struct pci_dev *pdev = to_pci_dev(dev->dev);
+#endif
if (!bios->fp.xlated_entry || !sub || !scriptofs)
return -EINVAL;
@@ -123,8 +126,8 @@ static int call_lvds_manufacturer_script(struct drm_device *dev, struct dcb_outp
#ifdef __powerpc__
/* Powerbook specific quirks */
if (script == LVDS_RESET &&
- (dev->pdev->device == 0x0179 || dev->pdev->device == 0x0189 ||
- dev->pdev->device == 0x0329))
+ (pdev->device == 0x0179 || pdev->device == 0x0189 ||
+ pdev->device == 0x0329))
nv_write_tmds(dev, dcbent->or, 0, 0x02, 0x72);
#endif
@@ -2080,11 +2083,13 @@ nouveau_bios_init(struct drm_device *dev)
{
struct nouveau_drm *drm = nouveau_drm(dev);
struct nvbios *bios = &drm->vbios;
+ struct pci_dev *pdev;
int ret;
/* only relevant for PCI devices */
- if (!dev->pdev)
+ if (!dev_is_pci(dev->dev))
return 0;
+ pdev = to_pci_dev(dev->dev);
if (!NVInitVBIOS(dev))
return -ENODEV;
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
index 8b4b3688c7ae..14c29e68db8f 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -411,6 +411,7 @@ static struct nouveau_encoder *
nouveau_connector_ddc_detect(struct drm_connector *connector)
{
struct drm_device *dev = connector->dev;
+ struct pci_dev *pdev = to_pci_dev(dev->dev);
struct nouveau_encoder *nv_encoder = NULL, *found = NULL;
struct drm_encoder *encoder;
int ret;
@@ -438,11 +439,11 @@ nouveau_connector_ddc_detect(struct drm_connector *connector)
break;
if (switcheroo_ddc)
- vga_switcheroo_lock_ddc(dev->pdev);
+ vga_switcheroo_lock_ddc(pdev);
if (nvkm_probe_i2c(nv_encoder->i2c, 0x50))
found = nv_encoder;
if (switcheroo_ddc)
- vga_switcheroo_unlock_ddc(dev->pdev);
+ vga_switcheroo_unlock_ddc(pdev);
break;
}
@@ -490,6 +491,7 @@ nouveau_connector_set_encoder(struct drm_connector *connector,
struct nouveau_connector *nv_connector = nouveau_connector(connector);
struct nouveau_drm *drm = nouveau_drm(connector->dev);
struct drm_device *dev = connector->dev;
+ struct pci_dev *pdev = to_pci_dev(dev->dev);
if (nv_connector->detected_encoder == nv_encoder)
return;
@@ -511,8 +513,8 @@ nouveau_connector_set_encoder(struct drm_connector *connector,
connector->doublescan_allowed = true;
if (drm->client.device.info.family == NV_DEVICE_INFO_V0_KELVIN ||
(drm->client.device.info.family == NV_DEVICE_INFO_V0_CELSIUS &&
- (dev->pdev->device & 0x0ff0) != 0x0100 &&
- (dev->pdev->device & 0x0ff0) != 0x0150))
+ (pdev->device & 0x0ff0) != 0x0100 &&
+ (pdev->device & 0x0ff0) != 0x0150))
/* HW is broken */
connector->interlace_allowed = false;
else
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index d141a5f004af..1b2169e9c295 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -115,8 +115,8 @@ nouveau_platform_name(struct platform_device *platformdev)
static u64
nouveau_name(struct drm_device *dev)
{
- if (dev->pdev)
- return nouveau_pci_name(dev->pdev);
+ if (dev_is_pci(dev->dev))
+ return nouveau_pci_name(to_pci_dev(dev->dev));
else
return nouveau_platform_name(to_platform_device(dev->dev));
}
@@ -760,7 +760,6 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
if (ret)
goto fail_drm;
- drm_dev->pdev = pdev;
pci_set_drvdata(pdev, drm_dev);
ret = nouveau_drm_device_init(drm_dev);
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
index 24ec5339efb4..4fc0fa696461 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
@@ -396,7 +396,9 @@ nouveau_fbcon_create(struct drm_fb_helper *helper,
NV_INFO(drm, "allocated %dx%d fb: 0x%llx, bo %p\n",
fb->width, fb->height, nvbo->offset, nvbo);
- vga_switcheroo_client_fb_set(dev->pdev, info);
+ if (dev_is_pci(dev->dev))
+ vga_switcheroo_client_fb_set(to_pci_dev(dev->dev), info);
+
return 0;
out_unlock:
@@ -548,7 +550,7 @@ nouveau_fbcon_init(struct drm_device *dev)
int ret;
if (!dev->mode_config.num_crtc ||
- (dev->pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
+ (to_pci_dev(dev->dev)->class >> 8) != PCI_CLASS_DISPLAY_VGA)
return 0;
fbcon = kzalloc(sizeof(struct nouveau_fbdev), GFP_KERNEL);
diff --git a/drivers/gpu/drm/nouveau/nouveau_vga.c b/drivers/gpu/drm/nouveau/nouveau_vga.c
index c85dd8afa3c3..7c4b374b3eca 100644
--- a/drivers/gpu/drm/nouveau/nouveau_vga.c
+++ b/drivers/gpu/drm/nouveau/nouveau_vga.c
@@ -87,18 +87,20 @@ nouveau_vga_init(struct nouveau_drm *drm)
{
struct drm_device *dev = drm->dev;
bool runtime = nouveau_pmops_runtime();
+ struct pci_dev *pdev;
/* only relevant for PCI devices */
- if (!dev->pdev)
+ if (!dev_is_pci(dev->dev))
return;
+ pdev = to_pci_dev(dev->dev);
- vga_client_register(dev->pdev, dev, NULL, nouveau_vga_set_decode);
+ vga_client_register(pdev, dev, NULL, nouveau_vga_set_decode);
/* don't register Thunderbolt eGPU with vga_switcheroo */
- if (pci_is_thunderbolt_attached(dev->pdev))
+ if (pci_is_thunderbolt_attached(pdev))
return;
- vga_switcheroo_register_client(dev->pdev, &nouveau_switcheroo_ops, runtime);
+ vga_switcheroo_register_client(pdev, &nouveau_switcheroo_ops, runtime);
if (runtime && nouveau_is_v1_dsm() && !nouveau_is_optimus())
vga_switcheroo_init_domain_pm_ops(drm->dev->dev, &drm->vga_pm_domain);
@@ -109,17 +111,19 @@ nouveau_vga_fini(struct nouveau_drm *drm)
{
struct drm_device *dev = drm->dev;
bool runtime = nouveau_pmops_runtime();
+ struct pci_dev *pdev;
/* only relevant for PCI devices */
- if (!dev->pdev)
+ if (!dev_is_pci(dev->dev))
return;
+ pdev = to_pci_dev(dev->dev);
- vga_client_register(dev->pdev, NULL, NULL, NULL);
+ vga_client_register(pdev, NULL, NULL, NULL);
- if (pci_is_thunderbolt_attached(dev->pdev))
+ if (pci_is_thunderbolt_attached(pdev))
return;
- vga_switcheroo_unregister_client(dev->pdev);
+ vga_switcheroo_unregister_client(pdev);
if (runtime && nouveau_is_v1_dsm() && !nouveau_is_optimus())
vga_switcheroo_fini_domain_pm_ops(drm->dev->dev);
}
--
2.29.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [Intel-gfx] [PATCH v3 8/8] drm: Upcast struct drm_device.dev to struct pci_device; replace pdev
2021-01-07 8:07 [Intel-gfx] [PATCH v3 0/8] drm: Move struct drm_device.pdev to legacy Thomas Zimmermann
` (6 preceding siblings ...)
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 7/8] drm/nouveau: " Thomas Zimmermann
@ 2021-01-07 8:07 ` Thomas Zimmermann
2021-01-07 9:45 ` kernel test robot
2021-01-07 9:47 ` [Intel-gfx] " kernel test robot
2021-01-07 15:33 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm: Move struct drm_device.pdev to legacy (rev3) Patchwork
8 siblings, 2 replies; 20+ messages in thread
From: Thomas Zimmermann @ 2021-01-07 8:07 UTC (permalink / raw)
To: airlied, daniel, jani.nikula, joonas.lahtinen, rodrigo.vivi
Cc: Sam Ravnborg, nouveau, intel-gfx, dri-devel, amd-gfx,
Thomas Zimmermann, intel-gvt-dev
We have DRM drivers based on USB, SPI and platform devices. All of them
are fine with storing their device reference in struct drm_device.dev.
PCI devices should be no exception. Therefore struct drm_device.pdev is
deprecated.
Instead upcast from struct drm_device.dev with to_pci_dev(). PCI-specific
code can use dev_is_pci() to test for a PCI device. This patch changes
the DRM core code and documentation accordingly. Struct drm_device.pdev
is being moved to legacy status.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
---
drivers/gpu/drm/drm_agpsupport.c | 9 ++++++---
drivers/gpu/drm/drm_bufs.c | 4 ++--
drivers/gpu/drm/drm_edid.c | 7 ++++++-
drivers/gpu/drm/drm_irq.c | 12 +++++++-----
drivers/gpu/drm/drm_pci.c | 26 +++++++++++++++-----------
drivers/gpu/drm/drm_vm.c | 2 +-
include/drm/drm_device.h | 12 +++++++++---
7 files changed, 46 insertions(+), 26 deletions(-)
diff --git a/drivers/gpu/drm/drm_agpsupport.c b/drivers/gpu/drm/drm_agpsupport.c
index 4c7ad46fdd21..a4040fe4f4ba 100644
--- a/drivers/gpu/drm/drm_agpsupport.c
+++ b/drivers/gpu/drm/drm_agpsupport.c
@@ -103,11 +103,13 @@ int drm_agp_info_ioctl(struct drm_device *dev, void *data,
*/
int drm_agp_acquire(struct drm_device *dev)
{
+ struct pci_dev *pdev = to_pci_dev(dev->dev);
+
if (!dev->agp)
return -ENODEV;
if (dev->agp->acquired)
return -EBUSY;
- dev->agp->bridge = agp_backend_acquire(dev->pdev);
+ dev->agp->bridge = agp_backend_acquire(pdev);
if (!dev->agp->bridge)
return -ENODEV;
dev->agp->acquired = 1;
@@ -402,14 +404,15 @@ int drm_agp_free_ioctl(struct drm_device *dev, void *data,
*/
struct drm_agp_head *drm_agp_init(struct drm_device *dev)
{
+ struct pci_dev *pdev = to_pci_dev(dev->dev);
struct drm_agp_head *head = NULL;
head = kzalloc(sizeof(*head), GFP_KERNEL);
if (!head)
return NULL;
- head->bridge = agp_find_bridge(dev->pdev);
+ head->bridge = agp_find_bridge(pdev);
if (!head->bridge) {
- head->bridge = agp_backend_acquire(dev->pdev);
+ head->bridge = agp_backend_acquire(pdev);
if (!head->bridge) {
kfree(head);
return NULL;
diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c
index aeb1327e3077..e3d77dfefb0a 100644
--- a/drivers/gpu/drm/drm_bufs.c
+++ b/drivers/gpu/drm/drm_bufs.c
@@ -326,7 +326,7 @@ static int drm_addmap_core(struct drm_device *dev, resource_size_t offset,
* As we're limiting the address to 2^32-1 (or less),
* casting it down to 32 bits is no problem, but we
* need to point to a 64bit variable first. */
- map->handle = dma_alloc_coherent(&dev->pdev->dev,
+ map->handle = dma_alloc_coherent(dev->dev,
map->size,
&map->offset,
GFP_KERNEL);
@@ -556,7 +556,7 @@ int drm_legacy_rmmap_locked(struct drm_device *dev, struct drm_local_map *map)
case _DRM_SCATTER_GATHER:
break;
case _DRM_CONSISTENT:
- dma_free_coherent(&dev->pdev->dev,
+ dma_free_coherent(dev->dev,
map->size,
map->handle,
map->offset);
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 394cc55b3214..c2bbe7bee7b6 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -32,6 +32,7 @@
#include <linux/i2c.h>
#include <linux/kernel.h>
#include <linux/module.h>
+#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/vga_switcheroo.h>
@@ -2075,9 +2076,13 @@ EXPORT_SYMBOL(drm_get_edid);
struct edid *drm_get_edid_switcheroo(struct drm_connector *connector,
struct i2c_adapter *adapter)
{
- struct pci_dev *pdev = connector->dev->pdev;
+ struct drm_device *dev = connector->dev;
+ struct pci_dev *pdev = to_pci_dev(dev->dev);
struct edid *edid;
+ if (drm_WARN_ON_ONCE(dev, !dev_is_pci(dev->dev)))
+ return NULL;
+
vga_switcheroo_lock_ddc(pdev);
edid = drm_get_edid(connector, adapter);
vga_switcheroo_unlock_ddc(pdev);
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 803af4bbd214..c3bd664ea733 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -122,7 +122,7 @@ int drm_irq_install(struct drm_device *dev, int irq)
dev->driver->irq_preinstall(dev);
/* PCI devices require shared interrupts. */
- if (dev->pdev)
+ if (dev_is_pci(dev->dev))
sh_flags = IRQF_SHARED;
ret = request_irq(irq, dev->driver->irq_handler,
@@ -140,7 +140,7 @@ int drm_irq_install(struct drm_device *dev, int irq)
if (ret < 0) {
dev->irq_enabled = false;
if (drm_core_check_feature(dev, DRIVER_LEGACY))
- vga_client_register(dev->pdev, NULL, NULL, NULL);
+ vga_client_register(to_pci_dev(dev->dev), NULL, NULL, NULL);
free_irq(irq, dev);
} else {
dev->irq = irq;
@@ -203,7 +203,7 @@ int drm_irq_uninstall(struct drm_device *dev)
DRM_DEBUG("irq=%d\n", dev->irq);
if (drm_core_check_feature(dev, DRIVER_LEGACY))
- vga_client_register(dev->pdev, NULL, NULL, NULL);
+ vga_client_register(to_pci_dev(dev->dev), NULL, NULL, NULL);
if (dev->driver->irq_uninstall)
dev->driver->irq_uninstall(dev);
@@ -252,6 +252,7 @@ int drm_legacy_irq_control(struct drm_device *dev, void *data,
{
struct drm_control *ctl = data;
int ret = 0, irq;
+ struct pci_dev *pdev;
/* if we haven't irq we fallback for compatibility reasons -
* this used to be a separate function in drm_dma.h
@@ -262,12 +263,13 @@ int drm_legacy_irq_control(struct drm_device *dev, void *data,
if (!drm_core_check_feature(dev, DRIVER_LEGACY))
return 0;
/* UMS was only ever supported on pci devices. */
- if (WARN_ON(!dev->pdev))
+ if (WARN_ON(!dev_is_pci(dev->dev)))
return -EINVAL;
switch (ctl->func) {
case DRM_INST_HANDLER:
- irq = dev->pdev->irq;
+ pdev = to_pci_dev(dev->dev);
+ irq = pdev->irq;
if (dev->if_version < DRM_IF_VERSION(1, 2) &&
ctl->irq != irq)
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
index 6dba4b8ce4fe..c7868418e36d 100644
--- a/drivers/gpu/drm/drm_pci.c
+++ b/drivers/gpu/drm/drm_pci.c
@@ -65,7 +65,7 @@ drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t ali
return NULL;
dmah->size = size;
- dmah->vaddr = dma_alloc_coherent(&dev->pdev->dev, size,
+ dmah->vaddr = dma_alloc_coherent(dev->dev, size,
&dmah->busaddr,
GFP_KERNEL);
@@ -88,7 +88,7 @@ EXPORT_SYMBOL(drm_pci_alloc);
*/
void drm_pci_free(struct drm_device * dev, drm_dma_handle_t * dmah)
{
- dma_free_coherent(&dev->pdev->dev, dmah->size, dmah->vaddr,
+ dma_free_coherent(dev->dev, dmah->size, dmah->vaddr,
dmah->busaddr);
kfree(dmah);
}
@@ -107,16 +107,18 @@ static int drm_get_pci_domain(struct drm_device *dev)
return 0;
#endif /* __alpha__ */
- return pci_domain_nr(dev->pdev->bus);
+ return pci_domain_nr(to_pci_dev(dev->dev)->bus);
}
int drm_pci_set_busid(struct drm_device *dev, struct drm_master *master)
{
+ struct pci_dev *pdev = to_pci_dev(dev->dev);
+
master->unique = kasprintf(GFP_KERNEL, "pci:%04x:%02x:%02x.%d",
drm_get_pci_domain(dev),
- dev->pdev->bus->number,
- PCI_SLOT(dev->pdev->devfn),
- PCI_FUNC(dev->pdev->devfn));
+ pdev->bus->number,
+ PCI_SLOT(pdev->devfn),
+ PCI_FUNC(pdev->devfn));
if (!master->unique)
return -ENOMEM;
@@ -126,12 +128,14 @@ int drm_pci_set_busid(struct drm_device *dev, struct drm_master *master)
static int drm_pci_irq_by_busid(struct drm_device *dev, struct drm_irq_busid *p)
{
+ struct pci_dev *pdev = to_pci_dev(dev->dev);
+
if ((p->busnum >> 8) != drm_get_pci_domain(dev) ||
- (p->busnum & 0xff) != dev->pdev->bus->number ||
- p->devnum != PCI_SLOT(dev->pdev->devfn) || p->funcnum != PCI_FUNC(dev->pdev->devfn))
+ (p->busnum & 0xff) != pdev->bus->number ||
+ p->devnum != PCI_SLOT(pdev->devfn) || p->funcnum != PCI_FUNC(pdev->devfn))
return -EINVAL;
- p->irq = dev->pdev->irq;
+ p->irq = pdev->irq;
DRM_DEBUG("%d:%d:%d => IRQ %d\n", p->busnum, p->devnum, p->funcnum,
p->irq);
@@ -159,7 +163,7 @@ int drm_legacy_irq_by_busid(struct drm_device *dev, void *data,
return -EOPNOTSUPP;
/* UMS was only ever support on PCI devices. */
- if (WARN_ON(!dev->pdev))
+ if (WARN_ON(!dev_is_pci(dev->dev)))
return -EINVAL;
if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
@@ -183,7 +187,7 @@ void drm_pci_agp_destroy(struct drm_device *dev)
static void drm_pci_agp_init(struct drm_device *dev)
{
if (drm_core_check_feature(dev, DRIVER_USE_AGP)) {
- if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP))
+ if (pci_find_capability(to_pci_dev(dev->dev), PCI_CAP_ID_AGP))
dev->agp = drm_agp_init(dev);
if (dev->agp) {
dev->agp->agp_mtrr = arch_phys_wc_add(
diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c
index 6d5a03b32238..9b3b989d7cad 100644
--- a/drivers/gpu/drm/drm_vm.c
+++ b/drivers/gpu/drm/drm_vm.c
@@ -278,7 +278,7 @@ static void drm_vm_shm_close(struct vm_area_struct *vma)
case _DRM_SCATTER_GATHER:
break;
case _DRM_CONSISTENT:
- dma_free_coherent(&dev->pdev->dev,
+ dma_free_coherent(dev->dev,
map->size,
map->handle,
map->offset);
diff --git a/include/drm/drm_device.h b/include/drm/drm_device.h
index 283a93ce4617..9d9db178119a 100644
--- a/include/drm/drm_device.h
+++ b/include/drm/drm_device.h
@@ -290,9 +290,6 @@ struct drm_device {
/** @agp: AGP data */
struct drm_agp_head *agp;
- /** @pdev: PCI device structure */
- struct pci_dev *pdev;
-
#ifdef __alpha__
/** @hose: PCI hose, only used on ALPHA platforms. */
struct pci_controller *hose;
@@ -336,6 +333,15 @@ struct drm_device {
/* Everything below here is for legacy driver, never use! */
/* private: */
#if IS_ENABLED(CONFIG_DRM_LEGACY)
+ /**
+ * @pdev: PCI device structure
+ *
+ * This is deprecated. to get the PCI device, upcast from @dev
+ * with to_pci_dev(). To test if the hardware is a PCI device,
+ * use dev_is_pci() with @dev.
+ */
+ struct pci_dev *pdev;
+
/* Context handle management - linked list of context handles */
struct list_head ctxlist;
--
2.29.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [Intel-gfx] [PATCH v3 8/8] drm: Upcast struct drm_device.dev to struct pci_device; replace pdev
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 8/8] drm: Upcast struct drm_device.dev to struct pci_device; replace pdev Thomas Zimmermann
@ 2021-01-07 9:45 ` kernel test robot
2021-01-07 10:45 ` Thomas Zimmermann
2021-01-07 9:47 ` [Intel-gfx] " kernel test robot
1 sibling, 1 reply; 20+ messages in thread
From: kernel test robot @ 2021-01-07 9:45 UTC (permalink / raw)
To: Thomas Zimmermann, airlied, daniel, jani.nikula, joonas.lahtinen,
rodrigo.vivi
Cc: kbuild-all, nouveau, intel-gfx, amd-gfx, dri-devel, Sam Ravnborg
[-- Attachment #1: Type: text/plain, Size: 11117 bytes --]
Hi Thomas,
I love your patch! Yet something to improve:
[auto build test ERROR on drm-tip/drm-tip]
[cannot apply to drm-intel/for-linux-next linus/master v5.11-rc2 next-20210104]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Thomas-Zimmermann/drm-Move-struct-drm_device-pdev-to-legacy/20210107-161007
base: git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: x86_64-randconfig-s021-20210107 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-208-g46a52ca4-dirty
# https://github.com/0day-ci/linux/commit/380912f7b62c23322562c40e19efd7ad84d57e9c
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Thomas-Zimmermann/drm-Move-struct-drm_device-pdev-to-legacy/20210107-161007
git checkout 380912f7b62c23322562c40e19efd7ad84d57e9c
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
drivers/gpu/drm/gma500/oaktrail_device.c: In function 'oaktrail_chip_setup':
>> drivers/gpu/drm/gma500/oaktrail_device.c:509:26: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
509 | if (pci_enable_msi(dev->pdev))
| ^~~~
| dev
--
drivers/gpu/drm/gma500/oaktrail_lvds.c: In function 'oaktrail_lvds_set_power':
>> drivers/gpu/drm/gma500/oaktrail_lvds.c:63:25: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
63 | pm_request_idle(&dev->pdev->dev);
| ^~~~
| dev
--
drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c: In function 'get_clock':
drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c:69:11: warning: variable 'tmp' set but not used [-Wunused-but-set-variable]
69 | u32 val, tmp;
| ^~~
drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c: In function 'get_data':
drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c:83:11: warning: variable 'tmp' set but not used [-Wunused-but-set-variable]
83 | u32 val, tmp;
| ^~~
drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c: In function 'oaktrail_lvds_i2c_init':
>> drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c:148:35: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
148 | chan->adapter.dev.parent = &dev->pdev->dev;
| ^~~~
| dev
--
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c: In function 'vmw_driver_load':
>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:661:22: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
661 | pci_set_master(dev->pdev);
| ^~~~
| dev
In file included from drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:31:
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:690:47: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
690 | dev_priv->io_start = pci_resource_start(dev->pdev, 0);
| ^~~~
include/linux/pci.h:1854:40: note: in definition of macro 'pci_resource_start'
1854 | #define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start)
| ^~~
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:691:49: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
691 | dev_priv->vram_start = pci_resource_start(dev->pdev, 1);
| ^~~~
include/linux/pci.h:1854:40: note: in definition of macro 'pci_resource_start'
1854 | #define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start)
| ^~~
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:692:49: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
692 | dev_priv->mmio_start = pci_resource_start(dev->pdev, 2);
| ^~~~
include/linux/pci.h:1854:40: note: in definition of macro 'pci_resource_start'
1854 | #define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start)
| ^~~
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:842:33: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
842 | ret = pci_request_regions(dev->pdev, "vmwgfx probe");
| ^~~~
| dev
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:851:33: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
851 | ret = pci_request_region(dev->pdev, 2, "vmwgfx stealth probe");
| ^~~~
| dev
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:859:35: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
859 | ret = vmw_irq_install(dev, dev->pdev->irq);
| ^~~~
| dev
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1005:27: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
1005 | pci_release_region(dev->pdev, 2);
| ^~~~
| dev
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1007:28: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
1007 | pci_release_regions(dev->pdev);
| ^~~~
| dev
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c: In function 'vmw_driver_unload':
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1056:27: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
1056 | pci_release_region(dev->pdev, 2);
| ^~~~
| dev
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1058:28: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
1058 | pci_release_regions(dev->pdev);
| ^~~~
| dev
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c: In function 'vmw_probe':
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1522:7: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
1522 | dev->pdev = pdev;
| ^~~~
| dev
--
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c: In function 'vmw_fb_init':
>> drivers/gpu/drm/vmwgfx/vmwgfx_fb.c:641:42: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
641 | struct device *device = &vmw_priv->dev->pdev->dev;
| ^~~~
| dev
In file included from drivers/gpu/drm/vmwgfx/vmwgfx_fb.c:35:
At top level:
drivers/gpu/drm/vmwgfx/vmwgfx_kms.h:256:23: warning: 'vmw_cursor_plane_formats' defined but not used [-Wunused-const-variable=]
256 | static const uint32_t vmw_cursor_plane_formats[] = {
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/vmwgfx/vmwgfx_kms.h:248:23: warning: 'vmw_primary_plane_formats' defined but not used [-Wunused-const-variable=]
248 | static const uint32_t vmw_primary_plane_formats[] = {
| ^~~~~~~~~~~~~~~~~~~~~~~~~
--
drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c: In function 'vmw_cmdbuf_set_pool_size':
>> drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c:1233:48: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
1233 | man->map = dma_alloc_coherent(&dev_priv->dev->pdev->dev, size,
| ^~~~
| dev
drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c: In function 'vmw_cmdbuf_man_create':
drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c:1316:28: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
1316 | &dev_priv->dev->pdev->dev,
| ^~~~
| dev
drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c:1325:22: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
1325 | &dev_priv->dev->pdev->dev,
| ^~~~
| dev
drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c: In function 'vmw_cmdbuf_remove_pool':
drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c:1390:42: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
1390 | dma_free_coherent(&man->dev_priv->dev->pdev->dev,
| ^~~~
| dev
vim +509 drivers/gpu/drm/gma500/oaktrail_device.c
1b082ccf5901108 Alan Cox 2011-11-03 503
1b22edfd6efd02b Alan Cox 2011-11-29 504 static int oaktrail_chip_setup(struct drm_device *dev)
aa0c45fdca0cff3 Alan Cox 2011-11-29 505 {
1b22edfd6efd02b Alan Cox 2011-11-29 506 struct drm_psb_private *dev_priv = dev->dev_private;
1b22edfd6efd02b Alan Cox 2011-11-29 507 int ret;
1b22edfd6efd02b Alan Cox 2011-11-29 508
9c0b6fcdc9faee5 Alan Cox 2012-05-11 @509 if (pci_enable_msi(dev->pdev))
9c0b6fcdc9faee5 Alan Cox 2012-05-11 510 dev_warn(dev->dev, "Enabling MSI failed!\n");
9c0b6fcdc9faee5 Alan Cox 2012-05-11 511
8512e0748729a49 Alan Cox 2012-05-11 512 dev_priv->regmap = oaktrail_regmap;
8512e0748729a49 Alan Cox 2012-05-11 513
1b22edfd6efd02b Alan Cox 2011-11-29 514 ret = mid_chip_setup(dev);
aa0c45fdca0cff3 Alan Cox 2011-11-29 515 if (ret < 0)
aa0c45fdca0cff3 Alan Cox 2011-11-29 516 return ret;
4086b1e2b19729e Kirill A. Shutemov 2012-05-03 517 if (!dev_priv->has_gct) {
aa0c45fdca0cff3 Alan Cox 2011-11-29 518 /* Now pull the BIOS data */
d839ede47a56ff5 Alan Cox 2012-05-03 519 psb_intel_opregion_init(dev);
aa0c45fdca0cff3 Alan Cox 2011-11-29 520 psb_intel_init_bios(dev);
aa0c45fdca0cff3 Alan Cox 2011-11-29 521 }
6528c897966c7d5 Patrik Jakobsson 2013-11-07 522 gma_intel_setup_gmbus(dev);
5f503148efdda26 Alan Cox 2012-05-03 523 oaktrail_hdmi_setup(dev);
aa0c45fdca0cff3 Alan Cox 2011-11-29 524 return 0;
aa0c45fdca0cff3 Alan Cox 2011-11-29 525 }
aa0c45fdca0cff3 Alan Cox 2011-11-29 526
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 35839 bytes --]
[-- Attachment #3: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [Intel-gfx] [PATCH v3 8/8] drm: Upcast struct drm_device.dev to struct pci_device; replace pdev
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 8/8] drm: Upcast struct drm_device.dev to struct pci_device; replace pdev Thomas Zimmermann
2021-01-07 9:45 ` kernel test robot
@ 2021-01-07 9:47 ` kernel test robot
1 sibling, 0 replies; 20+ messages in thread
From: kernel test robot @ 2021-01-07 9:47 UTC (permalink / raw)
To: Thomas Zimmermann, airlied, daniel, jani.nikula, joonas.lahtinen,
rodrigo.vivi
Cc: kbuild-all, nouveau, intel-gfx, amd-gfx, dri-devel, Sam Ravnborg
[-- Attachment #1: Type: text/plain, Size: 6045 bytes --]
Hi Thomas,
I love your patch! Yet something to improve:
[auto build test ERROR on drm-tip/drm-tip]
[cannot apply to drm-intel/for-linux-next linus/master v5.11-rc2 next-20210104]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Thomas-Zimmermann/drm-Move-struct-drm_device-pdev-to-legacy/20210107-161007
base: git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: microblaze-randconfig-r013-20210107 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/380912f7b62c23322562c40e19efd7ad84d57e9c
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Thomas-Zimmermann/drm-Move-struct-drm_device-pdev-to-legacy/20210107-161007
git checkout 380912f7b62c23322562c40e19efd7ad84d57e9c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=microblaze
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
drivers/gpu/drm/virtio/virtgpu_drv.c: In function 'virtio_gpu_pci_quirk':
>> drivers/gpu/drm/virtio/virtgpu_drv.c:57:7: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
57 | dev->pdev = pdev;
| ^~~~
| dev
vim +57 drivers/gpu/drm/virtio/virtgpu_drv.c
dc5698e80cf724 Dave Airlie 2013-09-09 46
d516e75c71c985 Ezequiel Garcia 2019-01-08 47 static int virtio_gpu_pci_quirk(struct drm_device *dev, struct virtio_device *vdev)
d516e75c71c985 Ezequiel Garcia 2019-01-08 48 {
d516e75c71c985 Ezequiel Garcia 2019-01-08 49 struct pci_dev *pdev = to_pci_dev(vdev->dev.parent);
d516e75c71c985 Ezequiel Garcia 2019-01-08 50 const char *pname = dev_name(&pdev->dev);
d516e75c71c985 Ezequiel Garcia 2019-01-08 51 bool vga = (pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA;
d516e75c71c985 Ezequiel Garcia 2019-01-08 52 char unique[20];
d516e75c71c985 Ezequiel Garcia 2019-01-08 53
d516e75c71c985 Ezequiel Garcia 2019-01-08 54 DRM_INFO("pci: %s detected at %s\n",
d516e75c71c985 Ezequiel Garcia 2019-01-08 55 vga ? "virtio-vga" : "virtio-gpu-pci",
d516e75c71c985 Ezequiel Garcia 2019-01-08 56 pname);
d516e75c71c985 Ezequiel Garcia 2019-01-08 @57 dev->pdev = pdev;
d516e75c71c985 Ezequiel Garcia 2019-01-08 58 if (vga)
d516e75c71c985 Ezequiel Garcia 2019-01-08 59 drm_fb_helper_remove_conflicting_pci_framebuffers(pdev,
d516e75c71c985 Ezequiel Garcia 2019-01-08 60 "virtiodrmfb");
d516e75c71c985 Ezequiel Garcia 2019-01-08 61
d516e75c71c985 Ezequiel Garcia 2019-01-08 62 /*
d516e75c71c985 Ezequiel Garcia 2019-01-08 63 * Normally the drm_dev_set_unique() call is done by core DRM.
d516e75c71c985 Ezequiel Garcia 2019-01-08 64 * The following comment covers, why virtio cannot rely on it.
d516e75c71c985 Ezequiel Garcia 2019-01-08 65 *
d516e75c71c985 Ezequiel Garcia 2019-01-08 66 * Unlike the other virtual GPU drivers, virtio abstracts the
d516e75c71c985 Ezequiel Garcia 2019-01-08 67 * underlying bus type by using struct virtio_device.
d516e75c71c985 Ezequiel Garcia 2019-01-08 68 *
d516e75c71c985 Ezequiel Garcia 2019-01-08 69 * Hence the dev_is_pci() check, used in core DRM, will fail
d516e75c71c985 Ezequiel Garcia 2019-01-08 70 * and the unique returned will be the virtio_device "virtio0",
d516e75c71c985 Ezequiel Garcia 2019-01-08 71 * while a "pci:..." one is required.
d516e75c71c985 Ezequiel Garcia 2019-01-08 72 *
d516e75c71c985 Ezequiel Garcia 2019-01-08 73 * A few other ideas were considered:
d516e75c71c985 Ezequiel Garcia 2019-01-08 74 * - Extend the dev_is_pci() check [in drm_set_busid] to
d516e75c71c985 Ezequiel Garcia 2019-01-08 75 * consider virtio.
d516e75c71c985 Ezequiel Garcia 2019-01-08 76 * Seems like a bigger hack than what we have already.
d516e75c71c985 Ezequiel Garcia 2019-01-08 77 *
d516e75c71c985 Ezequiel Garcia 2019-01-08 78 * - Point drm_device::dev to the parent of the virtio_device
d516e75c71c985 Ezequiel Garcia 2019-01-08 79 * Semantic changes:
d516e75c71c985 Ezequiel Garcia 2019-01-08 80 * * Using the wrong device for i2c, framebuffer_alloc and
d516e75c71c985 Ezequiel Garcia 2019-01-08 81 * prime import.
d516e75c71c985 Ezequiel Garcia 2019-01-08 82 * Visual changes:
d516e75c71c985 Ezequiel Garcia 2019-01-08 83 * * Helpers such as DRM_DEV_ERROR, dev_info, drm_printer,
d516e75c71c985 Ezequiel Garcia 2019-01-08 84 * will print the wrong information.
d516e75c71c985 Ezequiel Garcia 2019-01-08 85 *
d516e75c71c985 Ezequiel Garcia 2019-01-08 86 * We could address the latter issues, by introducing
d516e75c71c985 Ezequiel Garcia 2019-01-08 87 * drm_device::bus_dev, ... which would be used solely for this.
d516e75c71c985 Ezequiel Garcia 2019-01-08 88 *
d516e75c71c985 Ezequiel Garcia 2019-01-08 89 * So for the moment keep things as-is, with a bulky comment
d516e75c71c985 Ezequiel Garcia 2019-01-08 90 * for the next person who feels like removing this
d516e75c71c985 Ezequiel Garcia 2019-01-08 91 * drm_dev_set_unique() quirk.
d516e75c71c985 Ezequiel Garcia 2019-01-08 92 */
d516e75c71c985 Ezequiel Garcia 2019-01-08 93 snprintf(unique, sizeof(unique), "pci:%s", pname);
d516e75c71c985 Ezequiel Garcia 2019-01-08 94 return drm_dev_set_unique(dev, unique);
d516e75c71c985 Ezequiel Garcia 2019-01-08 95 }
d516e75c71c985 Ezequiel Garcia 2019-01-08 96
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28882 bytes --]
[-- Attachment #3: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [Intel-gfx] [PATCH v3 8/8] drm: Upcast struct drm_device.dev to struct pci_device; replace pdev
2021-01-07 9:45 ` kernel test robot
@ 2021-01-07 10:45 ` Thomas Zimmermann
2021-01-08 1:25 ` [Intel-gfx] [kbuild-all] " Rong Chen
0 siblings, 1 reply; 20+ messages in thread
From: Thomas Zimmermann @ 2021-01-07 10:45 UTC (permalink / raw)
To: kernel test robot, airlied, daniel, jani.nikula, joonas.lahtinen,
rodrigo.vivi
Cc: kbuild-all, nouveau, intel-gfx, amd-gfx, dri-devel, Sam Ravnborg
[-- Attachment #1.1.1: Type: text/plain, Size: 12078 bytes --]
AFAICT these are false positives. The instances have been fixed already.
Am 07.01.21 um 10:45 schrieb kernel test robot:
> Hi Thomas,
>
> I love your patch! Yet something to improve:
>
> [auto build test ERROR on drm-tip/drm-tip]
> [cannot apply to drm-intel/for-linux-next linus/master v5.11-rc2 next-20210104]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch]
>
> url: https://github.com/0day-ci/linux/commits/Thomas-Zimmermann/drm-Move-struct-drm_device-pdev-to-legacy/20210107-161007
> base: git://anongit.freedesktop.org/drm/drm-tip drm-tip
> config: x86_64-randconfig-s021-20210107 (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
> reproduce:
> # apt-get install sparse
> # sparse version: v0.6.3-208-g46a52ca4-dirty
> # https://github.com/0day-ci/linux/commit/380912f7b62c23322562c40e19efd7ad84d57e9c
> git remote add linux-review https://github.com/0day-ci/linux
> git fetch --no-tags linux-review Thomas-Zimmermann/drm-Move-struct-drm_device-pdev-to-legacy/20210107-161007
> git checkout 380912f7b62c23322562c40e19efd7ad84d57e9c
> # save the attached .config to linux build tree
> make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All errors (new ones prefixed by >>):
>
> drivers/gpu/drm/gma500/oaktrail_device.c: In function 'oaktrail_chip_setup':
>>> drivers/gpu/drm/gma500/oaktrail_device.c:509:26: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
> 509 | if (pci_enable_msi(dev->pdev))
> | ^~~~
> | dev
> --
> drivers/gpu/drm/gma500/oaktrail_lvds.c: In function 'oaktrail_lvds_set_power':
>>> drivers/gpu/drm/gma500/oaktrail_lvds.c:63:25: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
> 63 | pm_request_idle(&dev->pdev->dev);
> | ^~~~
> | dev
> --
> drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c: In function 'get_clock':
> drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c:69:11: warning: variable 'tmp' set but not used [-Wunused-but-set-variable]
> 69 | u32 val, tmp;
> | ^~~
> drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c: In function 'get_data':
> drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c:83:11: warning: variable 'tmp' set but not used [-Wunused-but-set-variable]
> 83 | u32 val, tmp;
> | ^~~
> drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c: In function 'oaktrail_lvds_i2c_init':
>>> drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c:148:35: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
> 148 | chan->adapter.dev.parent = &dev->pdev->dev;
> | ^~~~
> | dev
> --
> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c: In function 'vmw_driver_load':
>>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:661:22: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
> 661 | pci_set_master(dev->pdev);
> | ^~~~
> | dev
> In file included from drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:31:
> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:690:47: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
> 690 | dev_priv->io_start = pci_resource_start(dev->pdev, 0);
> | ^~~~
> include/linux/pci.h:1854:40: note: in definition of macro 'pci_resource_start'
> 1854 | #define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start)
> | ^~~
> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:691:49: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
> 691 | dev_priv->vram_start = pci_resource_start(dev->pdev, 1);
> | ^~~~
> include/linux/pci.h:1854:40: note: in definition of macro 'pci_resource_start'
> 1854 | #define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start)
> | ^~~
> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:692:49: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
> 692 | dev_priv->mmio_start = pci_resource_start(dev->pdev, 2);
> | ^~~~
> include/linux/pci.h:1854:40: note: in definition of macro 'pci_resource_start'
> 1854 | #define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start)
> | ^~~
> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:842:33: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
> 842 | ret = pci_request_regions(dev->pdev, "vmwgfx probe");
> | ^~~~
> | dev
> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:851:33: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
> 851 | ret = pci_request_region(dev->pdev, 2, "vmwgfx stealth probe");
> | ^~~~
> | dev
> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:859:35: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
> 859 | ret = vmw_irq_install(dev, dev->pdev->irq);
> | ^~~~
> | dev
> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1005:27: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
> 1005 | pci_release_region(dev->pdev, 2);
> | ^~~~
> | dev
> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1007:28: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
> 1007 | pci_release_regions(dev->pdev);
> | ^~~~
> | dev
> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c: In function 'vmw_driver_unload':
> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1056:27: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
> 1056 | pci_release_region(dev->pdev, 2);
> | ^~~~
> | dev
> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1058:28: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
> 1058 | pci_release_regions(dev->pdev);
> | ^~~~
> | dev
> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c: In function 'vmw_probe':
> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1522:7: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
> 1522 | dev->pdev = pdev;
> | ^~~~
> | dev
> --
> drivers/gpu/drm/vmwgfx/vmwgfx_fb.c: In function 'vmw_fb_init':
>>> drivers/gpu/drm/vmwgfx/vmwgfx_fb.c:641:42: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
> 641 | struct device *device = &vmw_priv->dev->pdev->dev;
> | ^~~~
> | dev
> In file included from drivers/gpu/drm/vmwgfx/vmwgfx_fb.c:35:
> At top level:
> drivers/gpu/drm/vmwgfx/vmwgfx_kms.h:256:23: warning: 'vmw_cursor_plane_formats' defined but not used [-Wunused-const-variable=]
> 256 | static const uint32_t vmw_cursor_plane_formats[] = {
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> drivers/gpu/drm/vmwgfx/vmwgfx_kms.h:248:23: warning: 'vmw_primary_plane_formats' defined but not used [-Wunused-const-variable=]
> 248 | static const uint32_t vmw_primary_plane_formats[] = {
> | ^~~~~~~~~~~~~~~~~~~~~~~~~
> --
> drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c: In function 'vmw_cmdbuf_set_pool_size':
>>> drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c:1233:48: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
> 1233 | man->map = dma_alloc_coherent(&dev_priv->dev->pdev->dev, size,
> | ^~~~
> | dev
> drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c: In function 'vmw_cmdbuf_man_create':
> drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c:1316:28: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
> 1316 | &dev_priv->dev->pdev->dev,
> | ^~~~
> | dev
> drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c:1325:22: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
> 1325 | &dev_priv->dev->pdev->dev,
> | ^~~~
> | dev
> drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c: In function 'vmw_cmdbuf_remove_pool':
> drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c:1390:42: error: 'struct drm_device' has no member named 'pdev'; did you mean 'dev'?
> 1390 | dma_free_coherent(&man->dev_priv->dev->pdev->dev,
> | ^~~~
> | dev
>
>
> vim +509 drivers/gpu/drm/gma500/oaktrail_device.c
>
> 1b082ccf5901108 Alan Cox 2011-11-03 503
> 1b22edfd6efd02b Alan Cox 2011-11-29 504 static int oaktrail_chip_setup(struct drm_device *dev)
> aa0c45fdca0cff3 Alan Cox 2011-11-29 505 {
> 1b22edfd6efd02b Alan Cox 2011-11-29 506 struct drm_psb_private *dev_priv = dev->dev_private;
> 1b22edfd6efd02b Alan Cox 2011-11-29 507 int ret;
> 1b22edfd6efd02b Alan Cox 2011-11-29 508
> 9c0b6fcdc9faee5 Alan Cox 2012-05-11 @509 if (pci_enable_msi(dev->pdev))
> 9c0b6fcdc9faee5 Alan Cox 2012-05-11 510 dev_warn(dev->dev, "Enabling MSI failed!\n");
> 9c0b6fcdc9faee5 Alan Cox 2012-05-11 511
> 8512e0748729a49 Alan Cox 2012-05-11 512 dev_priv->regmap = oaktrail_regmap;
> 8512e0748729a49 Alan Cox 2012-05-11 513
> 1b22edfd6efd02b Alan Cox 2011-11-29 514 ret = mid_chip_setup(dev);
> aa0c45fdca0cff3 Alan Cox 2011-11-29 515 if (ret < 0)
> aa0c45fdca0cff3 Alan Cox 2011-11-29 516 return ret;
> 4086b1e2b19729e Kirill A. Shutemov 2012-05-03 517 if (!dev_priv->has_gct) {
> aa0c45fdca0cff3 Alan Cox 2011-11-29 518 /* Now pull the BIOS data */
> d839ede47a56ff5 Alan Cox 2012-05-03 519 psb_intel_opregion_init(dev);
> aa0c45fdca0cff3 Alan Cox 2011-11-29 520 psb_intel_init_bios(dev);
> aa0c45fdca0cff3 Alan Cox 2011-11-29 521 }
> 6528c897966c7d5 Patrik Jakobsson 2013-11-07 522 gma_intel_setup_gmbus(dev);
> 5f503148efdda26 Alan Cox 2012-05-03 523 oaktrail_hdmi_setup(dev);
> aa0c45fdca0cff3 Alan Cox 2011-11-29 524 return 0;
> aa0c45fdca0cff3 Alan Cox 2011-11-29 525 }
> aa0c45fdca0cff3 Alan Cox 2011-11-29 526
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm: Move struct drm_device.pdev to legacy (rev3)
2021-01-07 8:07 [Intel-gfx] [PATCH v3 0/8] drm: Move struct drm_device.pdev to legacy Thomas Zimmermann
` (7 preceding siblings ...)
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 8/8] drm: Upcast struct drm_device.dev to struct pci_device; replace pdev Thomas Zimmermann
@ 2021-01-07 15:33 ` Patchwork
8 siblings, 0 replies; 20+ messages in thread
From: Patchwork @ 2021-01-07 15:33 UTC (permalink / raw)
To: Thomas Zimmermann; +Cc: intel-gfx
== Series Details ==
Series: drm: Move struct drm_device.pdev to legacy (rev3)
URL : https://patchwork.freedesktop.org/series/84205/
State : failure
== Summary ==
Applying: drm/amdgpu: Fix trailing whitespaces
Applying: drm/amdgpu: Remove references to struct drm_device.pdev
Applying: drm/hibmc: Remove references to struct drm_device.pdev
Applying: drm/i915: Remove references to struct drm_device.pdev
Applying: drm/i915/gt: Remove references to struct drm_device.pdev
Applying: drm/i915/gvt: Remove references to struct drm_device.pdev
Applying: drm/nouveau: Remove references to struct drm_device.pdev
Applying: drm: Upcast struct drm_device.dev to struct pci_device; replace pdev
Using index info to reconstruct a base tree...
M drivers/gpu/drm/drm_pci.c
M include/drm/drm_device.h
Falling back to patching base and 3-way merge...
Auto-merging include/drm/drm_device.h
CONFLICT (content): Merge conflict in include/drm/drm_device.h
Auto-merging drivers/gpu/drm/drm_pci.c
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0008 drm: Upcast struct drm_device.dev to struct pci_device; replace pdev
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [Intel-gfx] [kbuild-all] Re: [PATCH v3 8/8] drm: Upcast struct drm_device.dev to struct pci_device; replace pdev
2021-01-07 10:45 ` Thomas Zimmermann
@ 2021-01-08 1:25 ` Rong Chen
2021-01-08 8:04 ` Thomas Zimmermann
0 siblings, 1 reply; 20+ messages in thread
From: Rong Chen @ 2021-01-08 1:25 UTC (permalink / raw)
To: Thomas Zimmermann, kernel test robot, airlied, daniel,
jani.nikula, joonas.lahtinen, rodrigo.vivi
Cc: kbuild-all, nouveau, intel-gfx, amd-gfx, dri-devel, Sam Ravnborg
Hi Thomas,
Thanks for the feedback, do you mean the patch was applied to a wrong base?
Best Regards,
Rong Chen
On 1/7/21 6:45 PM, Thomas Zimmermann wrote:
> AFAICT these are false positives. The instances have been fixed already.
>
> Am 07.01.21 um 10:45 schrieb kernel test robot:
>> Hi Thomas,
>>
>> I love your patch! Yet something to improve:
>>
>> [auto build test ERROR on drm-tip/drm-tip]
>> [cannot apply to drm-intel/for-linux-next linus/master v5.11-rc2
>> next-20210104]
>> [If your patch is applied to the wrong git tree, kindly drop us a note.
>> And when submitting patch, we suggest to use '--base' as documented in
>> https://git-scm.com/docs/git-format-patch]
>>
>> url:
>> https://github.com/0day-ci/linux/commits/Thomas-Zimmermann/drm-Move-struct-drm_device-pdev-to-legacy/20210107-161007
>> base: git://anongit.freedesktop.org/drm/drm-tip drm-tip
>> config: x86_64-randconfig-s021-20210107 (attached as .config)
>> compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
>> reproduce:
>> # apt-get install sparse
>> # sparse version: v0.6.3-208-g46a52ca4-dirty
>> #
>> https://github.com/0day-ci/linux/commit/380912f7b62c23322562c40e19efd7ad84d57e9c
>> git remote add linux-review https://github.com/0day-ci/linux
>> git fetch --no-tags linux-review
>> Thomas-Zimmermann/drm-Move-struct-drm_device-pdev-to-legacy/20210107-161007
>> git checkout 380912f7b62c23322562c40e19efd7ad84d57e9c
>> # save the attached .config to linux build tree
>> make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
>> ARCH=x86_64
>>
>> If you fix the issue, kindly add following tag as appropriate
>> Reported-by: kernel test robot <lkp@intel.com>
>>
>> All errors (new ones prefixed by >>):
>>
>> drivers/gpu/drm/gma500/oaktrail_device.c: In function
>> 'oaktrail_chip_setup':
>>>> drivers/gpu/drm/gma500/oaktrail_device.c:509:26: error: 'struct
>>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>> 509 | if (pci_enable_msi(dev->pdev))
>> | ^~~~
>> | dev
>> --
>> drivers/gpu/drm/gma500/oaktrail_lvds.c: In function
>> 'oaktrail_lvds_set_power':
>>>> drivers/gpu/drm/gma500/oaktrail_lvds.c:63:25: error: 'struct
>>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>> 63 | pm_request_idle(&dev->pdev->dev);
>> | ^~~~
>> | dev
>> --
>> drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c: In function 'get_clock':
>> drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c:69:11: warning:
>> variable 'tmp' set but not used [-Wunused-but-set-variable]
>> 69 | u32 val, tmp;
>> | ^~~
>> drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c: In function 'get_data':
>> drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c:83:11: warning:
>> variable 'tmp' set but not used [-Wunused-but-set-variable]
>> 83 | u32 val, tmp;
>> | ^~~
>> drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c: In function
>> 'oaktrail_lvds_i2c_init':
>>>> drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c:148:35: error: 'struct
>>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>> 148 | chan->adapter.dev.parent = &dev->pdev->dev;
>> | ^~~~
>> | dev
>> --
>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c: In function 'vmw_driver_load':
>>>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:661:22: error: 'struct
>>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>> 661 | pci_set_master(dev->pdev);
>> | ^~~~
>> | dev
>> In file included from drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:31:
>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:690:47: error: 'struct
>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>> 690 | dev_priv->io_start = pci_resource_start(dev->pdev, 0);
>> | ^~~~
>> include/linux/pci.h:1854:40: note: in definition of macro
>> 'pci_resource_start'
>> 1854 | #define pci_resource_start(dev, bar)
>> ((dev)->resource[(bar)].start)
>> | ^~~
>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:691:49: error: 'struct
>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>> 691 | dev_priv->vram_start = pci_resource_start(dev->pdev, 1);
>> | ^~~~
>> include/linux/pci.h:1854:40: note: in definition of macro
>> 'pci_resource_start'
>> 1854 | #define pci_resource_start(dev, bar)
>> ((dev)->resource[(bar)].start)
>> | ^~~
>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:692:49: error: 'struct
>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>> 692 | dev_priv->mmio_start = pci_resource_start(dev->pdev, 2);
>> | ^~~~
>> include/linux/pci.h:1854:40: note: in definition of macro
>> 'pci_resource_start'
>> 1854 | #define pci_resource_start(dev, bar)
>> ((dev)->resource[(bar)].start)
>> | ^~~
>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:842:33: error: 'struct
>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>> 842 | ret = pci_request_regions(dev->pdev, "vmwgfx probe");
>> | ^~~~
>> | dev
>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:851:33: error: 'struct
>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>> 851 | ret = pci_request_region(dev->pdev, 2, "vmwgfx stealth
>> probe");
>> | ^~~~
>> | dev
>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:859:35: error: 'struct
>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>> 859 | ret = vmw_irq_install(dev, dev->pdev->irq);
>> | ^~~~
>> | dev
>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1005:27: error: 'struct
>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>> 1005 | pci_release_region(dev->pdev, 2);
>> | ^~~~
>> | dev
>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1007:28: error: 'struct
>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>> 1007 | pci_release_regions(dev->pdev);
>> | ^~~~
>> | dev
>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c: In function
>> 'vmw_driver_unload':
>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1056:27: error: 'struct
>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>> 1056 | pci_release_region(dev->pdev, 2);
>> | ^~~~
>> | dev
>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1058:28: error: 'struct
>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>> 1058 | pci_release_regions(dev->pdev);
>> | ^~~~
>> | dev
>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c: In function 'vmw_probe':
>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1522:7: error: 'struct
>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>> 1522 | dev->pdev = pdev;
>> | ^~~~
>> | dev
>> --
>> drivers/gpu/drm/vmwgfx/vmwgfx_fb.c: In function 'vmw_fb_init':
>>>> drivers/gpu/drm/vmwgfx/vmwgfx_fb.c:641:42: error: 'struct
>>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>> 641 | struct device *device = &vmw_priv->dev->pdev->dev;
>> | ^~~~
>> | dev
>> In file included from drivers/gpu/drm/vmwgfx/vmwgfx_fb.c:35:
>> At top level:
>> drivers/gpu/drm/vmwgfx/vmwgfx_kms.h:256:23: warning:
>> 'vmw_cursor_plane_formats' defined but not used
>> [-Wunused-const-variable=]
>> 256 | static const uint32_t vmw_cursor_plane_formats[] = {
>> | ^~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/vmwgfx/vmwgfx_kms.h:248:23: warning:
>> 'vmw_primary_plane_formats' defined but not used
>> [-Wunused-const-variable=]
>> 248 | static const uint32_t vmw_primary_plane_formats[] = {
>> | ^~~~~~~~~~~~~~~~~~~~~~~~~
>> --
>> drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c: In function
>> 'vmw_cmdbuf_set_pool_size':
>>>> drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c:1233:48: error: 'struct
>>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>> 1233 | man->map = dma_alloc_coherent(&dev_priv->dev->pdev->dev,
>> size,
>> | ^~~~
>> | dev
>> drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c: In function
>> 'vmw_cmdbuf_man_create':
>> drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c:1316:28: error: 'struct
>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>> 1316 | &dev_priv->dev->pdev->dev,
>> | ^~~~
>> | dev
>> drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c:1325:22: error: 'struct
>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>> 1325 | &dev_priv->dev->pdev->dev,
>> | ^~~~
>> | dev
>> drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c: In function
>> 'vmw_cmdbuf_remove_pool':
>> drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c:1390:42: error: 'struct
>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>> 1390 | dma_free_coherent(&man->dev_priv->dev->pdev->dev,
>> | ^~~~
>> | dev
>>
>>
>> vim +509 drivers/gpu/drm/gma500/oaktrail_device.c
>>
>> 1b082ccf5901108 Alan Cox 2011-11-03 503
>> 1b22edfd6efd02b Alan Cox 2011-11-29 504 static int
>> oaktrail_chip_setup(struct drm_device *dev)
>> aa0c45fdca0cff3 Alan Cox 2011-11-29 505 {
>> 1b22edfd6efd02b Alan Cox 2011-11-29 506 struct
>> drm_psb_private *dev_priv = dev->dev_private;
>> 1b22edfd6efd02b Alan Cox 2011-11-29 507 int ret;
>> 1b22edfd6efd02b Alan Cox 2011-11-29 508
>> 9c0b6fcdc9faee5 Alan Cox 2012-05-11 @509 if
>> (pci_enable_msi(dev->pdev))
>> 9c0b6fcdc9faee5 Alan Cox 2012-05-11 510 dev_warn(dev->dev,
>> "Enabling MSI failed!\n");
>> 9c0b6fcdc9faee5 Alan Cox 2012-05-11 511
>> 8512e0748729a49 Alan Cox 2012-05-11 512 dev_priv->regmap =
>> oaktrail_regmap;
>> 8512e0748729a49 Alan Cox 2012-05-11 513
>> 1b22edfd6efd02b Alan Cox 2011-11-29 514 ret =
>> mid_chip_setup(dev);
>> aa0c45fdca0cff3 Alan Cox 2011-11-29 515 if (ret < 0)
>> aa0c45fdca0cff3 Alan Cox 2011-11-29 516 return ret;
>> 4086b1e2b19729e Kirill A. Shutemov 2012-05-03 517 if
>> (!dev_priv->has_gct) {
>> aa0c45fdca0cff3 Alan Cox 2011-11-29 518 /* Now
>> pull the BIOS data */
>> d839ede47a56ff5 Alan Cox 2012-05-03 519
>> psb_intel_opregion_init(dev);
>> aa0c45fdca0cff3 Alan Cox 2011-11-29 520
>> psb_intel_init_bios(dev);
>> aa0c45fdca0cff3 Alan Cox 2011-11-29 521 }
>> 6528c897966c7d5 Patrik Jakobsson 2013-11-07 522
>> gma_intel_setup_gmbus(dev);
>> 5f503148efdda26 Alan Cox 2012-05-03 523
>> oaktrail_hdmi_setup(dev);
>> aa0c45fdca0cff3 Alan Cox 2011-11-29 524 return 0;
>> aa0c45fdca0cff3 Alan Cox 2011-11-29 525 }
>> aa0c45fdca0cff3 Alan Cox 2011-11-29 526
>>
>> ---
>> 0-DAY CI Kernel Test Service, Intel Corporation
>> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
>>
>
>
> _______________________________________________
> kbuild-all mailing list -- kbuild-all@lists.01.org
> To unsubscribe send an email to kbuild-all-leave@lists.01.org
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [Intel-gfx] [kbuild-all] Re: [PATCH v3 8/8] drm: Upcast struct drm_device.dev to struct pci_device; replace pdev
2021-01-08 1:25 ` [Intel-gfx] [kbuild-all] " Rong Chen
@ 2021-01-08 8:04 ` Thomas Zimmermann
2021-01-08 9:02 ` Daniel Vetter
0 siblings, 1 reply; 20+ messages in thread
From: Thomas Zimmermann @ 2021-01-08 8:04 UTC (permalink / raw)
To: Rong Chen, kernel test robot, airlied, daniel, jani.nikula,
joonas.lahtinen, rodrigo.vivi
Cc: kbuild-all, nouveau, intel-gfx, amd-gfx, dri-devel, Sam Ravnborg
[-- Attachment #1.1.1: Type: text/plain, Size: 13413 bytes --]
Hi
Am 08.01.21 um 02:25 schrieb Rong Chen:
> Hi Thomas,
>
> Thanks for the feedback, do you mean the patch was applied to a wrong base?
I'm on drm-tip, which already has the patches that fix these issues. I
think I should start using git's --base option when sending out patchsets.
Best regards
Thomas
>
> Best Regards,
> Rong Chen
>
> On 1/7/21 6:45 PM, Thomas Zimmermann wrote:
>> AFAICT these are false positives. The instances have been fixed already.
>>
>> Am 07.01.21 um 10:45 schrieb kernel test robot:
>>> Hi Thomas,
>>>
>>> I love your patch! Yet something to improve:
>>>
>>> [auto build test ERROR on drm-tip/drm-tip]
>>> [cannot apply to drm-intel/for-linux-next linus/master v5.11-rc2
>>> next-20210104]
>>> [If your patch is applied to the wrong git tree, kindly drop us a note.
>>> And when submitting patch, we suggest to use '--base' as documented in
>>> https://git-scm.com/docs/git-format-patch]
>>>
>>> url:
>>> https://github.com/0day-ci/linux/commits/Thomas-Zimmermann/drm-Move-struct-drm_device-pdev-to-legacy/20210107-161007
>>>
>>> base: git://anongit.freedesktop.org/drm/drm-tip drm-tip
>>> config: x86_64-randconfig-s021-20210107 (attached as .config)
>>> compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
>>> reproduce:
>>> # apt-get install sparse
>>> # sparse version: v0.6.3-208-g46a52ca4-dirty
>>> #
>>> https://github.com/0day-ci/linux/commit/380912f7b62c23322562c40e19efd7ad84d57e9c
>>>
>>> git remote add linux-review https://github.com/0day-ci/linux
>>> git fetch --no-tags linux-review
>>> Thomas-Zimmermann/drm-Move-struct-drm_device-pdev-to-legacy/20210107-161007
>>>
>>> git checkout 380912f7b62c23322562c40e19efd7ad84d57e9c
>>> # save the attached .config to linux build tree
>>> make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
>>> ARCH=x86_64
>>>
>>> If you fix the issue, kindly add following tag as appropriate
>>> Reported-by: kernel test robot <lkp@intel.com>
>>>
>>> All errors (new ones prefixed by >>):
>>>
>>> drivers/gpu/drm/gma500/oaktrail_device.c: In function
>>> 'oaktrail_chip_setup':
>>>>> drivers/gpu/drm/gma500/oaktrail_device.c:509:26: error: 'struct
>>>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>>> 509 | if (pci_enable_msi(dev->pdev))
>>> | ^~~~
>>> | dev
>>> --
>>> drivers/gpu/drm/gma500/oaktrail_lvds.c: In function
>>> 'oaktrail_lvds_set_power':
>>>>> drivers/gpu/drm/gma500/oaktrail_lvds.c:63:25: error: 'struct
>>>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>>> 63 | pm_request_idle(&dev->pdev->dev);
>>> | ^~~~
>>> | dev
>>> --
>>> drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c: In function 'get_clock':
>>> drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c:69:11: warning:
>>> variable 'tmp' set but not used [-Wunused-but-set-variable]
>>> 69 | u32 val, tmp;
>>> | ^~~
>>> drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c: In function 'get_data':
>>> drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c:83:11: warning:
>>> variable 'tmp' set but not used [-Wunused-but-set-variable]
>>> 83 | u32 val, tmp;
>>> | ^~~
>>> drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c: In function
>>> 'oaktrail_lvds_i2c_init':
>>>>> drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c:148:35: error: 'struct
>>>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>>> 148 | chan->adapter.dev.parent = &dev->pdev->dev;
>>> | ^~~~
>>> | dev
>>> --
>>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c: In function 'vmw_driver_load':
>>>>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:661:22: error: 'struct
>>>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>>> 661 | pci_set_master(dev->pdev);
>>> | ^~~~
>>> | dev
>>> In file included from drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:31:
>>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:690:47: error: 'struct
>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>>> 690 | dev_priv->io_start = pci_resource_start(dev->pdev, 0);
>>> | ^~~~
>>> include/linux/pci.h:1854:40: note: in definition of macro
>>> 'pci_resource_start'
>>> 1854 | #define pci_resource_start(dev, bar)
>>> ((dev)->resource[(bar)].start)
>>> | ^~~
>>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:691:49: error: 'struct
>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>>> 691 | dev_priv->vram_start = pci_resource_start(dev->pdev, 1);
>>> | ^~~~
>>> include/linux/pci.h:1854:40: note: in definition of macro
>>> 'pci_resource_start'
>>> 1854 | #define pci_resource_start(dev, bar)
>>> ((dev)->resource[(bar)].start)
>>> | ^~~
>>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:692:49: error: 'struct
>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>>> 692 | dev_priv->mmio_start = pci_resource_start(dev->pdev, 2);
>>> | ^~~~
>>> include/linux/pci.h:1854:40: note: in definition of macro
>>> 'pci_resource_start'
>>> 1854 | #define pci_resource_start(dev, bar)
>>> ((dev)->resource[(bar)].start)
>>> | ^~~
>>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:842:33: error: 'struct
>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>>> 842 | ret = pci_request_regions(dev->pdev, "vmwgfx probe");
>>> | ^~~~
>>> | dev
>>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:851:33: error: 'struct
>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>>> 851 | ret = pci_request_region(dev->pdev, 2, "vmwgfx stealth
>>> probe");
>>> | ^~~~
>>> | dev
>>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:859:35: error: 'struct
>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>>> 859 | ret = vmw_irq_install(dev, dev->pdev->irq);
>>> | ^~~~
>>> | dev
>>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1005:27: error: 'struct
>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>>> 1005 | pci_release_region(dev->pdev, 2);
>>> | ^~~~
>>> | dev
>>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1007:28: error: 'struct
>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>>> 1007 | pci_release_regions(dev->pdev);
>>> | ^~~~
>>> | dev
>>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c: In function
>>> 'vmw_driver_unload':
>>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1056:27: error: 'struct
>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>>> 1056 | pci_release_region(dev->pdev, 2);
>>> | ^~~~
>>> | dev
>>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1058:28: error: 'struct
>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>>> 1058 | pci_release_regions(dev->pdev);
>>> | ^~~~
>>> | dev
>>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c: In function 'vmw_probe':
>>> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1522:7: error: 'struct
>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>>> 1522 | dev->pdev = pdev;
>>> | ^~~~
>>> | dev
>>> --
>>> drivers/gpu/drm/vmwgfx/vmwgfx_fb.c: In function 'vmw_fb_init':
>>>>> drivers/gpu/drm/vmwgfx/vmwgfx_fb.c:641:42: error: 'struct
>>>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>>> 641 | struct device *device = &vmw_priv->dev->pdev->dev;
>>> | ^~~~
>>> | dev
>>> In file included from drivers/gpu/drm/vmwgfx/vmwgfx_fb.c:35:
>>> At top level:
>>> drivers/gpu/drm/vmwgfx/vmwgfx_kms.h:256:23: warning:
>>> 'vmw_cursor_plane_formats' defined but not used
>>> [-Wunused-const-variable=]
>>> 256 | static const uint32_t vmw_cursor_plane_formats[] = {
>>> | ^~~~~~~~~~~~~~~~~~~~~~~~
>>> drivers/gpu/drm/vmwgfx/vmwgfx_kms.h:248:23: warning:
>>> 'vmw_primary_plane_formats' defined but not used
>>> [-Wunused-const-variable=]
>>> 248 | static const uint32_t vmw_primary_plane_formats[] = {
>>> | ^~~~~~~~~~~~~~~~~~~~~~~~~
>>> --
>>> drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c: In function
>>> 'vmw_cmdbuf_set_pool_size':
>>>>> drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c:1233:48: error: 'struct
>>>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>>> 1233 | man->map = dma_alloc_coherent(&dev_priv->dev->pdev->dev,
>>> size,
>>> | ^~~~
>>> | dev
>>> drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c: In function
>>> 'vmw_cmdbuf_man_create':
>>> drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c:1316:28: error: 'struct
>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>>> 1316 | &dev_priv->dev->pdev->dev,
>>> | ^~~~
>>> | dev
>>> drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c:1325:22: error: 'struct
>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>>> 1325 | &dev_priv->dev->pdev->dev,
>>> | ^~~~
>>> | dev
>>> drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c: In function
>>> 'vmw_cmdbuf_remove_pool':
>>> drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c:1390:42: error: 'struct
>>> drm_device' has no member named 'pdev'; did you mean 'dev'?
>>> 1390 | dma_free_coherent(&man->dev_priv->dev->pdev->dev,
>>> | ^~~~
>>> | dev
>>>
>>>
>>> vim +509 drivers/gpu/drm/gma500/oaktrail_device.c
>>>
>>> 1b082ccf5901108 Alan Cox 2011-11-03 503
>>> 1b22edfd6efd02b Alan Cox 2011-11-29 504 static int
>>> oaktrail_chip_setup(struct drm_device *dev)
>>> aa0c45fdca0cff3 Alan Cox 2011-11-29 505 {
>>> 1b22edfd6efd02b Alan Cox 2011-11-29 506 struct
>>> drm_psb_private *dev_priv = dev->dev_private;
>>> 1b22edfd6efd02b Alan Cox 2011-11-29 507 int ret;
>>> 1b22edfd6efd02b Alan Cox 2011-11-29 508
>>> 9c0b6fcdc9faee5 Alan Cox 2012-05-11 @509 if
>>> (pci_enable_msi(dev->pdev))
>>> 9c0b6fcdc9faee5 Alan Cox 2012-05-11 510 dev_warn(dev->dev,
>>> "Enabling MSI failed!\n");
>>> 9c0b6fcdc9faee5 Alan Cox 2012-05-11 511
>>> 8512e0748729a49 Alan Cox 2012-05-11 512 dev_priv->regmap =
>>> oaktrail_regmap;
>>> 8512e0748729a49 Alan Cox 2012-05-11 513
>>> 1b22edfd6efd02b Alan Cox 2011-11-29 514 ret =
>>> mid_chip_setup(dev);
>>> aa0c45fdca0cff3 Alan Cox 2011-11-29 515 if (ret < 0)
>>> aa0c45fdca0cff3 Alan Cox 2011-11-29 516 return ret;
>>> 4086b1e2b19729e Kirill A. Shutemov 2012-05-03 517 if
>>> (!dev_priv->has_gct) {
>>> aa0c45fdca0cff3 Alan Cox 2011-11-29 518 /* Now
>>> pull the BIOS data */
>>> d839ede47a56ff5 Alan Cox 2012-05-03 519
>>> psb_intel_opregion_init(dev);
>>> aa0c45fdca0cff3 Alan Cox 2011-11-29 520
>>> psb_intel_init_bios(dev);
>>> aa0c45fdca0cff3 Alan Cox 2011-11-29 521 }
>>> 6528c897966c7d5 Patrik Jakobsson 2013-11-07 522
>>> gma_intel_setup_gmbus(dev);
>>> 5f503148efdda26 Alan Cox 2012-05-03 523
>>> oaktrail_hdmi_setup(dev);
>>> aa0c45fdca0cff3 Alan Cox 2011-11-29 524 return 0;
>>> aa0c45fdca0cff3 Alan Cox 2011-11-29 525 }
>>> aa0c45fdca0cff3 Alan Cox 2011-11-29 526
>>>
>>> ---
>>> 0-DAY CI Kernel Test Service, Intel Corporation
>>> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
>>>
>>
>>
>> _______________________________________________
>> kbuild-all mailing list -- kbuild-all@lists.01.org
>> To unsubscribe send an email to kbuild-all-leave@lists.01.org
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [Intel-gfx] [kbuild-all] Re: [PATCH v3 8/8] drm: Upcast struct drm_device.dev to struct pci_device; replace pdev
2021-01-08 8:04 ` Thomas Zimmermann
@ 2021-01-08 9:02 ` Daniel Vetter
0 siblings, 0 replies; 20+ messages in thread
From: Daniel Vetter @ 2021-01-08 9:02 UTC (permalink / raw)
To: Thomas Zimmermann
Cc: amd-gfx, kbuild-all, Rong Chen, airlied, nouveau, intel-gfx,
dri-devel, Sam Ravnborg
On Fri, Jan 08, 2021 at 09:04:44AM +0100, Thomas Zimmermann wrote:
> Hi
>
> Am 08.01.21 um 02:25 schrieb Rong Chen:
> > Hi Thomas,
> >
> > Thanks for the feedback, do you mean the patch was applied to a wrong base?
>
> I'm on drm-tip, which already has the patches that fix these issues. I think
> I should start using git's --base option when sending out patchsets.
From today all the patches should also be in linux-next. Our maintainer
script didn't push the branches to the right tags because drm-misc-fixes
wasn't rolled forward yet (there's some trickery to make sure we don't
push patches to linux-next for the subsequent merge window before -rc1 is
tagged).
-Daniel
>
> Best regards
> Thomas
>
> >
> > Best Regards,
> > Rong Chen
> >
> > On 1/7/21 6:45 PM, Thomas Zimmermann wrote:
> > > AFAICT these are false positives. The instances have been fixed already.
> > >
> > > Am 07.01.21 um 10:45 schrieb kernel test robot:
> > > > Hi Thomas,
> > > >
> > > > I love your patch! Yet something to improve:
> > > >
> > > > [auto build test ERROR on drm-tip/drm-tip]
> > > > [cannot apply to drm-intel/for-linux-next linus/master v5.11-rc2
> > > > next-20210104]
> > > > [If your patch is applied to the wrong git tree, kindly drop us a note.
> > > > And when submitting patch, we suggest to use '--base' as documented in
> > > > https://git-scm.com/docs/git-format-patch]
> > > >
> > > > url: https://github.com/0day-ci/linux/commits/Thomas-Zimmermann/drm-Move-struct-drm_device-pdev-to-legacy/20210107-161007
> > > >
> > > > base: git://anongit.freedesktop.org/drm/drm-tip drm-tip
> > > > config: x86_64-randconfig-s021-20210107 (attached as .config)
> > > > compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
> > > > reproduce:
> > > > # apt-get install sparse
> > > > # sparse version: v0.6.3-208-g46a52ca4-dirty
> > > > # https://github.com/0day-ci/linux/commit/380912f7b62c23322562c40e19efd7ad84d57e9c
> > > >
> > > > git remote add linux-review https://github.com/0day-ci/linux
> > > > git fetch --no-tags linux-review Thomas-Zimmermann/drm-Move-struct-drm_device-pdev-to-legacy/20210107-161007
> > > >
> > > > git checkout 380912f7b62c23322562c40e19efd7ad84d57e9c
> > > > # save the attached .config to linux build tree
> > > > make W=1 C=1 CF='-fdiagnostic-prefix
> > > > -D__CHECK_ENDIAN__' ARCH=x86_64
> > > >
> > > > If you fix the issue, kindly add following tag as appropriate
> > > > Reported-by: kernel test robot <lkp@intel.com>
> > > >
> > > > All errors (new ones prefixed by >>):
> > > >
> > > > drivers/gpu/drm/gma500/oaktrail_device.c: In function
> > > > 'oaktrail_chip_setup':
> > > > > > drivers/gpu/drm/gma500/oaktrail_device.c:509:26: error:
> > > > > > 'struct drm_device' has no member named 'pdev'; did you
> > > > > > mean 'dev'?
> > > > 509 | if (pci_enable_msi(dev->pdev))
> > > > | ^~~~
> > > > | dev
> > > > --
> > > > drivers/gpu/drm/gma500/oaktrail_lvds.c: In function
> > > > 'oaktrail_lvds_set_power':
> > > > > > drivers/gpu/drm/gma500/oaktrail_lvds.c:63:25: error:
> > > > > > 'struct drm_device' has no member named 'pdev'; did you
> > > > > > mean 'dev'?
> > > > 63 | pm_request_idle(&dev->pdev->dev);
> > > > | ^~~~
> > > > | dev
> > > > --
> > > > drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c: In function 'get_clock':
> > > > drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c:69:11: warning:
> > > > variable 'tmp' set but not used [-Wunused-but-set-variable]
> > > > 69 | u32 val, tmp;
> > > > | ^~~
> > > > drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c: In function 'get_data':
> > > > drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c:83:11: warning:
> > > > variable 'tmp' set but not used [-Wunused-but-set-variable]
> > > > 83 | u32 val, tmp;
> > > > | ^~~
> > > > drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c: In function
> > > > 'oaktrail_lvds_i2c_init':
> > > > > > drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c:148:35:
> > > > > > error: 'struct drm_device' has no member named 'pdev';
> > > > > > did you mean 'dev'?
> > > > 148 | chan->adapter.dev.parent = &dev->pdev->dev;
> > > > | ^~~~
> > > > | dev
> > > > --
> > > > drivers/gpu/drm/vmwgfx/vmwgfx_drv.c: In function 'vmw_driver_load':
> > > > > > drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:661:22: error:
> > > > > > 'struct drm_device' has no member named 'pdev'; did you
> > > > > > mean 'dev'?
> > > > 661 | pci_set_master(dev->pdev);
> > > > | ^~~~
> > > > | dev
> > > > In file included from drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:31:
> > > > drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:690:47: error: 'struct
> > > > drm_device' has no member named 'pdev'; did you mean 'dev'?
> > > > 690 | dev_priv->io_start = pci_resource_start(dev->pdev, 0);
> > > > | ^~~~
> > > > include/linux/pci.h:1854:40: note: in definition of macro
> > > > 'pci_resource_start'
> > > > 1854 | #define pci_resource_start(dev, bar)
> > > > ((dev)->resource[(bar)].start)
> > > > | ^~~
> > > > drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:691:49: error: 'struct
> > > > drm_device' has no member named 'pdev'; did you mean 'dev'?
> > > > 691 | dev_priv->vram_start = pci_resource_start(dev->pdev, 1);
> > > > | ^~~~
> > > > include/linux/pci.h:1854:40: note: in definition of macro
> > > > 'pci_resource_start'
> > > > 1854 | #define pci_resource_start(dev, bar)
> > > > ((dev)->resource[(bar)].start)
> > > > | ^~~
> > > > drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:692:49: error: 'struct
> > > > drm_device' has no member named 'pdev'; did you mean 'dev'?
> > > > 692 | dev_priv->mmio_start = pci_resource_start(dev->pdev, 2);
> > > > | ^~~~
> > > > include/linux/pci.h:1854:40: note: in definition of macro
> > > > 'pci_resource_start'
> > > > 1854 | #define pci_resource_start(dev, bar)
> > > > ((dev)->resource[(bar)].start)
> > > > | ^~~
> > > > drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:842:33: error: 'struct
> > > > drm_device' has no member named 'pdev'; did you mean 'dev'?
> > > > 842 | ret = pci_request_regions(dev->pdev, "vmwgfx probe");
> > > > | ^~~~
> > > > | dev
> > > > drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:851:33: error: 'struct
> > > > drm_device' has no member named 'pdev'; did you mean 'dev'?
> > > > 851 | ret = pci_request_region(dev->pdev, 2, "vmwgfx
> > > > stealth probe");
> > > > | ^~~~
> > > > | dev
> > > > drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:859:35: error: 'struct
> > > > drm_device' has no member named 'pdev'; did you mean 'dev'?
> > > > 859 | ret = vmw_irq_install(dev, dev->pdev->irq);
> > > > | ^~~~
> > > > | dev
> > > > drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1005:27: error: 'struct
> > > > drm_device' has no member named 'pdev'; did you mean 'dev'?
> > > > 1005 | pci_release_region(dev->pdev, 2);
> > > > | ^~~~
> > > > | dev
> > > > drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1007:28: error: 'struct
> > > > drm_device' has no member named 'pdev'; did you mean 'dev'?
> > > > 1007 | pci_release_regions(dev->pdev);
> > > > | ^~~~
> > > > | dev
> > > > drivers/gpu/drm/vmwgfx/vmwgfx_drv.c: In function
> > > > 'vmw_driver_unload':
> > > > drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1056:27: error: 'struct
> > > > drm_device' has no member named 'pdev'; did you mean 'dev'?
> > > > 1056 | pci_release_region(dev->pdev, 2);
> > > > | ^~~~
> > > > | dev
> > > > drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1058:28: error: 'struct
> > > > drm_device' has no member named 'pdev'; did you mean 'dev'?
> > > > 1058 | pci_release_regions(dev->pdev);
> > > > | ^~~~
> > > > | dev
> > > > drivers/gpu/drm/vmwgfx/vmwgfx_drv.c: In function 'vmw_probe':
> > > > drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1522:7: error: 'struct
> > > > drm_device' has no member named 'pdev'; did you mean 'dev'?
> > > > 1522 | dev->pdev = pdev;
> > > > | ^~~~
> > > > | dev
> > > > --
> > > > drivers/gpu/drm/vmwgfx/vmwgfx_fb.c: In function 'vmw_fb_init':
> > > > > > drivers/gpu/drm/vmwgfx/vmwgfx_fb.c:641:42: error:
> > > > > > 'struct drm_device' has no member named 'pdev'; did you
> > > > > > mean 'dev'?
> > > > 641 | struct device *device = &vmw_priv->dev->pdev->dev;
> > > > | ^~~~
> > > > | dev
> > > > In file included from drivers/gpu/drm/vmwgfx/vmwgfx_fb.c:35:
> > > > At top level:
> > > > drivers/gpu/drm/vmwgfx/vmwgfx_kms.h:256:23: warning:
> > > > 'vmw_cursor_plane_formats' defined but not used
> > > > [-Wunused-const-variable=]
> > > > 256 | static const uint32_t vmw_cursor_plane_formats[] = {
> > > > | ^~~~~~~~~~~~~~~~~~~~~~~~
> > > > drivers/gpu/drm/vmwgfx/vmwgfx_kms.h:248:23: warning:
> > > > 'vmw_primary_plane_formats' defined but not used
> > > > [-Wunused-const-variable=]
> > > > 248 | static const uint32_t vmw_primary_plane_formats[] = {
> > > > | ^~~~~~~~~~~~~~~~~~~~~~~~~
> > > > --
> > > > drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c: In function
> > > > 'vmw_cmdbuf_set_pool_size':
> > > > > > drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c:1233:48: error:
> > > > > > 'struct drm_device' has no member named 'pdev'; did you
> > > > > > mean 'dev'?
> > > > 1233 | man->map =
> > > > dma_alloc_coherent(&dev_priv->dev->pdev->dev, size,
> > > > | ^~~~
> > > > | dev
> > > > drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c: In function
> > > > 'vmw_cmdbuf_man_create':
> > > > drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c:1316:28: error:
> > > > 'struct drm_device' has no member named 'pdev'; did you mean
> > > > 'dev'?
> > > > 1316 | &dev_priv->dev->pdev->dev,
> > > > | ^~~~
> > > > | dev
> > > > drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c:1325:22: error:
> > > > 'struct drm_device' has no member named 'pdev'; did you mean
> > > > 'dev'?
> > > > 1325 | &dev_priv->dev->pdev->dev,
> > > > | ^~~~
> > > > | dev
> > > > drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c: In function
> > > > 'vmw_cmdbuf_remove_pool':
> > > > drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c:1390:42: error:
> > > > 'struct drm_device' has no member named 'pdev'; did you mean
> > > > 'dev'?
> > > > 1390 | dma_free_coherent(&man->dev_priv->dev->pdev->dev,
> > > > | ^~~~
> > > > | dev
> > > >
> > > >
> > > > vim +509 drivers/gpu/drm/gma500/oaktrail_device.c
> > > >
> > > > 1b082ccf5901108 Alan Cox 2011-11-03 503
> > > > 1b22edfd6efd02b Alan Cox 2011-11-29 504 static int
> > > > oaktrail_chip_setup(struct drm_device *dev)
> > > > aa0c45fdca0cff3 Alan Cox 2011-11-29 505 {
> > > > 1b22edfd6efd02b Alan Cox 2011-11-29 506 struct
> > > > drm_psb_private *dev_priv = dev->dev_private;
> > > > 1b22edfd6efd02b Alan Cox 2011-11-29 507 int ret;
> > > > 1b22edfd6efd02b Alan Cox 2011-11-29 508
> > > > 9c0b6fcdc9faee5 Alan Cox 2012-05-11 @509 if
> > > > (pci_enable_msi(dev->pdev))
> > > > 9c0b6fcdc9faee5 Alan Cox 2012-05-11 510
> > > > dev_warn(dev->dev, "Enabling MSI failed!\n");
> > > > 9c0b6fcdc9faee5 Alan Cox 2012-05-11 511
> > > > 8512e0748729a49 Alan Cox 2012-05-11 512
> > > > dev_priv->regmap = oaktrail_regmap;
> > > > 8512e0748729a49 Alan Cox 2012-05-11 513
> > > > 1b22edfd6efd02b Alan Cox 2011-11-29 514 ret =
> > > > mid_chip_setup(dev);
> > > > aa0c45fdca0cff3 Alan Cox 2011-11-29 515 if (ret < 0)
> > > > aa0c45fdca0cff3 Alan Cox 2011-11-29 516 return ret;
> > > > 4086b1e2b19729e Kirill A. Shutemov 2012-05-03 517 if
> > > > (!dev_priv->has_gct) {
> > > > aa0c45fdca0cff3 Alan Cox 2011-11-29 518 /*
> > > > Now pull the BIOS data */
> > > > d839ede47a56ff5 Alan Cox 2012-05-03 519
> > > > psb_intel_opregion_init(dev);
> > > > aa0c45fdca0cff3 Alan Cox 2011-11-29 520
> > > > psb_intel_init_bios(dev);
> > > > aa0c45fdca0cff3 Alan Cox 2011-11-29 521 }
> > > > 6528c897966c7d5 Patrik Jakobsson 2013-11-07 522
> > > > gma_intel_setup_gmbus(dev);
> > > > 5f503148efdda26 Alan Cox 2012-05-03 523
> > > > oaktrail_hdmi_setup(dev);
> > > > aa0c45fdca0cff3 Alan Cox 2011-11-29 524 return 0;
> > > > aa0c45fdca0cff3 Alan Cox 2011-11-29 525 }
> > > > aa0c45fdca0cff3 Alan Cox 2011-11-29 526
> > > >
> > > > ---
> > > > 0-DAY CI Kernel Test Service, Intel Corporation
> > > > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
> > > >
> > >
> > >
> > > _______________________________________________
> > > kbuild-all mailing list -- kbuild-all@lists.01.org
> > > To unsubscribe send an email to kbuild-all-leave@lists.01.org
> >
>
> --
> Thomas Zimmermann
> Graphics Driver Developer
> SUSE Software Solutions Germany GmbH
> Maxfeldstr. 5, 90409 Nürnberg, Germany
> (HRB 36809, AG Nürnberg)
> Geschäftsführer: Felix Imendörffer
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [Intel-gfx] [PATCH v3 2/8] drm/amdgpu: Remove references to struct drm_device.pdev
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 2/8] drm/amdgpu: Remove references to struct drm_device.pdev Thomas Zimmermann
@ 2021-01-18 13:50 ` Christian König
2021-01-18 14:40 ` Thomas Zimmermann
0 siblings, 1 reply; 20+ messages in thread
From: Christian König @ 2021-01-18 13:50 UTC (permalink / raw)
To: Thomas Zimmermann, airlied, daniel, jani.nikula, joonas.lahtinen,
rodrigo.vivi
Cc: Sam Ravnborg, nouveau, intel-gfx, dri-devel, amd-gfx,
Alex Deucher, intel-gvt-dev
Hi Thomas,
this patch unfortunately completely broke amdgpu.
See the splat below:
[ 74.553881]
==================================================================
[ 74.554060] BUG: KASAN: null-ptr-deref in
drm_pci_set_busid+0x38/0x100 [drm]
[ 74.554393] Read of size 4 at addr 0000000000000038 by task Xorg/1115
[ 74.554585] CPU: 6 PID: 1115 Comm: Xorg Not tainted 5.11.0-rc2+ #75
[ 74.554594] Hardware name: System manufacturer System Product
Name/PRIME X399-A, BIOS 0808 10/12/2018
[ 74.554600] Call Trace:
[ 74.554605] dump_stack+0x9d/0xce
[ 74.554616] ? drm_pci_set_busid+0x38/0x100 [drm]
[ 74.554787] kasan_report.cold+0x5d/0xd1
[ 74.554799] ? drm_pci_set_busid+0x38/0x100 [drm]
[ 74.554969] __asan_load4+0x6b/0x90
[ 74.554978] drm_pci_set_busid+0x38/0x100 [drm]
[ 74.555148] drm_setversion+0x2ce/0x350 [drm]
[ 74.555315] ? drm_is_current_master+0x5d/0x70 [drm]
[ 74.555481] drm_ioctl_kernel+0x16d/0x1c0 [drm]
[ 74.555648] ? drm_ioctl_permit+0xb0/0xb0 [drm]
[ 74.555811] ? drm_setversion+0x350/0x350 [drm]
[ 74.555973] ? check_stack_object+0x2d/0xb0
[ 74.555985] drm_ioctl+0x363/0x5a0 [drm]
[ 74.556147] ? drm_ioctl_permit+0xb0/0xb0 [drm]
[ 74.556310] ? drm_ioctl_kernel+0x1c0/0x1c0 [drm]
[ 74.556473] ? __kasan_check_write+0x14/0x20
[ 74.556481] ? _raw_spin_lock_irqsave+0x8e/0xf0
[ 74.556492] ? _raw_spin_trylock_bh+0x100/0x100
[ 74.556504] amdgpu_drm_ioctl+0x7e/0xd0 [amdgpu]
[ 74.557409] __x64_sys_ioctl+0xc3/0x100
[ 74.557418] do_syscall_64+0x38/0x90
[ 74.557427] entry_SYSCALL_64_after_hwframe+0x44/0xa9
Any idea what's going wrong here?
Thanks in advance,
Christian.
Am 07.01.21 um 09:07 schrieb Thomas Zimmermann:
> Using struct drm_device.pdev is deprecated. Convert amdgpu to struct
> drm_device.dev. No functional changes.
>
> v3:
> * rebased
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Acked-by: Christian König <christian.koenig@amd.com>
> Acked-by: Alex Deucher <alexander.deucher@amd.com>
> Acked-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 17 ++++++++---------
> drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 1 +
> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 -
> drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 2 +-
> drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 10 +++++-----
> drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c | 2 +-
> drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 10 +++++-----
> 7 files changed, 21 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 7d16395ede0a..f7e2a878411e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -1423,9 +1423,9 @@ static void amdgpu_switcheroo_set_state(struct pci_dev *pdev,
> /* don't suspend or resume card normally */
> dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
>
> - pci_set_power_state(dev->pdev, PCI_D0);
> - amdgpu_device_load_pci_state(dev->pdev);
> - r = pci_enable_device(dev->pdev);
> + pci_set_power_state(pdev, PCI_D0);
> + amdgpu_device_load_pci_state(pdev);
> + r = pci_enable_device(pdev);
> if (r)
> DRM_WARN("pci_enable_device failed (%d)\n", r);
> amdgpu_device_resume(dev, true);
> @@ -1437,10 +1437,10 @@ static void amdgpu_switcheroo_set_state(struct pci_dev *pdev,
> drm_kms_helper_poll_disable(dev);
> dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
> amdgpu_device_suspend(dev, true);
> - amdgpu_device_cache_pci_state(dev->pdev);
> + amdgpu_device_cache_pci_state(pdev);
> /* Shut down the device */
> - pci_disable_device(dev->pdev);
> - pci_set_power_state(dev->pdev, PCI_D3cold);
> + pci_disable_device(pdev);
> + pci_set_power_state(pdev, PCI_D3cold);
> dev->switch_power_state = DRM_SWITCH_POWER_OFF;
> }
> }
> @@ -1703,8 +1703,7 @@ static void amdgpu_device_enable_virtual_display(struct amdgpu_device *adev)
> adev->enable_virtual_display = false;
>
> if (amdgpu_virtual_display) {
> - struct drm_device *ddev = adev_to_drm(adev);
> - const char *pci_address_name = pci_name(ddev->pdev);
> + const char *pci_address_name = pci_name(adev->pdev);
> char *pciaddstr, *pciaddstr_tmp, *pciaddname_tmp, *pciaddname;
>
> pciaddstr = kstrdup(amdgpu_virtual_display, GFP_KERNEL);
> @@ -3397,7 +3396,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
> }
> }
>
> - pci_enable_pcie_error_reporting(adev->ddev.pdev);
> + pci_enable_pcie_error_reporting(adev->pdev);
>
> /* Post card if necessary */
> if (amdgpu_device_need_post(adev)) {
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> index f764803c53a4..0150a51b65ef 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> @@ -926,6 +926,7 @@ amdgpu_display_user_framebuffer_create(struct drm_device *dev,
> struct drm_file *file_priv,
> const struct drm_mode_fb_cmd2 *mode_cmd)
> {
> + struct amdgpu_device *adev = drm_to_adev(dev);
> struct drm_gem_object *obj;
> struct amdgpu_framebuffer *amdgpu_fb;
> int ret;
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 72efd579ec5e..b4ea67e12ada 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -1204,7 +1204,6 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
> if (ret)
> return ret;
>
> - ddev->pdev = pdev;
> pci_set_drvdata(pdev, ddev);
>
> ret = amdgpu_driver_load_kms(adev, ent->driver_data);
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
> index 0bf7d36c6686..51cd49c6f38f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
> @@ -271,7 +271,7 @@ static int amdgpufb_create(struct drm_fb_helper *helper,
> DRM_INFO("fb depth is %d\n", fb->format->depth);
> DRM_INFO(" pitch is %d\n", fb->pitches[0]);
>
> - vga_switcheroo_client_fb_set(adev_to_drm(adev)->pdev, info);
> + vga_switcheroo_client_fb_set(adev->pdev, info);
> return 0;
>
> out:
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> index d0a1fee1f5f6..a5c42c3004a0 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> @@ -619,7 +619,7 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev, void *data,
> int r = 0;
>
> if (args->va_address < AMDGPU_VA_RESERVED_SIZE) {
> - dev_dbg(&dev->pdev->dev,
> + dev_dbg(dev->dev,
> "va_address 0x%LX is in reserved area 0x%LX\n",
> args->va_address, AMDGPU_VA_RESERVED_SIZE);
> return -EINVAL;
> @@ -627,7 +627,7 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev, void *data,
>
> if (args->va_address >= AMDGPU_GMC_HOLE_START &&
> args->va_address < AMDGPU_GMC_HOLE_END) {
> - dev_dbg(&dev->pdev->dev,
> + dev_dbg(dev->dev,
> "va_address 0x%LX is in VA hole 0x%LX-0x%LX\n",
> args->va_address, AMDGPU_GMC_HOLE_START,
> AMDGPU_GMC_HOLE_END);
> @@ -639,14 +639,14 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev, void *data,
> vm_size = adev->vm_manager.max_pfn * AMDGPU_GPU_PAGE_SIZE;
> vm_size -= AMDGPU_VA_RESERVED_SIZE;
> if (args->va_address + args->map_size > vm_size) {
> - dev_dbg(&dev->pdev->dev,
> + dev_dbg(dev->dev,
> "va_address 0x%llx is in top reserved area 0x%llx\n",
> args->va_address + args->map_size, vm_size);
> return -EINVAL;
> }
>
> if ((args->flags & ~valid_flags) && (args->flags & ~prt_flags)) {
> - dev_dbg(&dev->pdev->dev, "invalid flags combination 0x%08X\n",
> + dev_dbg(dev->dev, "invalid flags combination 0x%08X\n",
> args->flags);
> return -EINVAL;
> }
> @@ -658,7 +658,7 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev, void *data,
> case AMDGPU_VA_OP_REPLACE:
> break;
> default:
> - dev_dbg(&dev->pdev->dev, "unsupported operation %d\n",
> + dev_dbg(dev->dev, "unsupported operation %d\n",
> args->operation);
> return -EINVAL;
> }
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
> index 47cad23a6b9e..bca4dddd5a15 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
> @@ -176,7 +176,7 @@ struct amdgpu_i2c_chan *amdgpu_i2c_create(struct drm_device *dev,
> i2c->rec = *rec;
> i2c->adapter.owner = THIS_MODULE;
> i2c->adapter.class = I2C_CLASS_DDC;
> - i2c->adapter.dev.parent = &dev->pdev->dev;
> + i2c->adapter.dev.parent = dev->dev;
> i2c->dev = dev;
> i2c_set_adapdata(&i2c->adapter, i2c);
> mutex_init(&i2c->mutex);
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> index b16b32797624..3c37cf1ae8b7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> @@ -142,7 +142,7 @@ int amdgpu_driver_load_kms(struct amdgpu_device *adev, unsigned long flags)
> (amdgpu_is_atpx_hybrid() ||
> amdgpu_has_atpx_dgpu_power_cntl()) &&
> ((flags & AMD_IS_APU) == 0) &&
> - !pci_is_thunderbolt_attached(dev->pdev))
> + !pci_is_thunderbolt_attached(to_pci_dev(dev->dev)))
> flags |= AMD_IS_PX;
>
> parent = pci_upstream_bridge(adev->pdev);
> @@ -156,7 +156,7 @@ int amdgpu_driver_load_kms(struct amdgpu_device *adev, unsigned long flags)
> */
> r = amdgpu_device_init(adev, flags);
> if (r) {
> - dev_err(&dev->pdev->dev, "Fatal error during GPU init\n");
> + dev_err(dev->dev, "Fatal error during GPU init\n");
> goto out;
> }
>
> @@ -199,7 +199,7 @@ int amdgpu_driver_load_kms(struct amdgpu_device *adev, unsigned long flags)
>
> acpi_status = amdgpu_acpi_init(adev);
> if (acpi_status)
> - dev_dbg(&dev->pdev->dev, "Error during ACPI methods call\n");
> + dev_dbg(dev->dev, "Error during ACPI methods call\n");
>
> if (adev->runpm) {
> /* only need to skip on ATPX */
> @@ -735,10 +735,10 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
> if (!dev_info)
> return -ENOMEM;
>
> - dev_info->device_id = dev->pdev->device;
> + dev_info->device_id = adev->pdev->device;
> dev_info->chip_rev = adev->rev_id;
> dev_info->external_rev = adev->external_rev_id;
> - dev_info->pci_rev = dev->pdev->revision;
> + dev_info->pci_rev = adev->pdev->revision;
> dev_info->family = adev->family;
> dev_info->num_shader_engines = adev->gfx.config.max_shader_engines;
> dev_info->num_shader_arrays_per_engine = adev->gfx.config.max_sh_per_se;
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [Intel-gfx] [PATCH v3 2/8] drm/amdgpu: Remove references to struct drm_device.pdev
2021-01-18 13:50 ` Christian König
@ 2021-01-18 14:40 ` Thomas Zimmermann
2021-01-18 14:56 ` Daniel Vetter
0 siblings, 1 reply; 20+ messages in thread
From: Thomas Zimmermann @ 2021-01-18 14:40 UTC (permalink / raw)
To: Christian König, airlied, daniel, jani.nikula,
joonas.lahtinen, rodrigo.vivi
Cc: intel-gvt-dev, nouveau, intel-gfx, amd-gfx, dri-devel,
Alex Deucher, Sam Ravnborg
[-- Attachment #1.1.1: Type: text/plain, Size: 14104 bytes --]
Hi
Am 18.01.21 um 14:50 schrieb Christian König:
> Hi Thomas,
>
> this patch unfortunately completely broke amdgpu.
>
> See the splat below:
>
> [ 74.553881]
> ==================================================================
> [ 74.554060] BUG: KASAN: null-ptr-deref in
> drm_pci_set_busid+0x38/0x100 [drm]
> [ 74.554393] Read of size 4 at addr 0000000000000038 by task Xorg/1115
>
> [ 74.554585] CPU: 6 PID: 1115 Comm: Xorg Not tainted 5.11.0-rc2+ #75
> [ 74.554594] Hardware name: System manufacturer System Product
> Name/PRIME X399-A, BIOS 0808 10/12/2018
> [ 74.554600] Call Trace:
> [ 74.554605] dump_stack+0x9d/0xce
> [ 74.554616] ? drm_pci_set_busid+0x38/0x100 [drm]
> [ 74.554787] kasan_report.cold+0x5d/0xd1
> [ 74.554799] ? drm_pci_set_busid+0x38/0x100 [drm]
> [ 74.554969] __asan_load4+0x6b/0x90
> [ 74.554978] drm_pci_set_busid+0x38/0x100 [drm]
> [ 74.555148] drm_setversion+0x2ce/0x350 [drm]
> [ 74.555315] ? drm_is_current_master+0x5d/0x70 [drm]
> [ 74.555481] drm_ioctl_kernel+0x16d/0x1c0 [drm]
> [ 74.555648] ? drm_ioctl_permit+0xb0/0xb0 [drm]
> [ 74.555811] ? drm_setversion+0x350/0x350 [drm]
> [ 74.555973] ? check_stack_object+0x2d/0xb0
> [ 74.555985] drm_ioctl+0x363/0x5a0 [drm]
> [ 74.556147] ? drm_ioctl_permit+0xb0/0xb0 [drm]
> [ 74.556310] ? drm_ioctl_kernel+0x1c0/0x1c0 [drm]
> [ 74.556473] ? __kasan_check_write+0x14/0x20
> [ 74.556481] ? _raw_spin_lock_irqsave+0x8e/0xf0
> [ 74.556492] ? _raw_spin_trylock_bh+0x100/0x100
> [ 74.556504] amdgpu_drm_ioctl+0x7e/0xd0 [amdgpu]
> [ 74.557409] __x64_sys_ioctl+0xc3/0x100
> [ 74.557418] do_syscall_64+0x38/0x90
> [ 74.557427] entry_SYSCALL_64_after_hwframe+0x44/0xa9
>
> Any idea what's going wrong here?
I meanwhile posted an updated patchset with a fix in patch 1. [1] Maybe
you can apply this one and test.
The original bug report and testing is at [2]. Apparently, DRM core has
to be changed together with drivers. I'm honestly not sure why.
Best regards
Thomas
[1]
https://lore.kernel.org/dri-devel/20210118131420.15874-1-tzimmermann@suse.de/T/#m8a0cdf02375a4e23e194d2e7eb80e8738632ea84
[2]
https://lore.kernel.org/dri-devel/7851c78c-8c57-3c84-cd49-a72703095a5d@suse.de/
>
> Thanks in advance,
> Christian.
>
> Am 07.01.21 um 09:07 schrieb Thomas Zimmermann:
>> Using struct drm_device.pdev is deprecated. Convert amdgpu to struct
>> drm_device.dev. No functional changes.
>>
>> v3:
>> * rebased
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> Acked-by: Christian König <christian.koenig@amd.com>
>> Acked-by: Alex Deucher <alexander.deucher@amd.com>
>> Acked-by: Sam Ravnborg <sam@ravnborg.org>
>> Cc: Alex Deucher <alexander.deucher@amd.com>
>> Cc: Christian König <christian.koenig@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 17 ++++++++---------
>> drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 1 +
>> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 -
>> drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 2 +-
>> drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 10 +++++-----
>> drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c | 2 +-
>> drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 10 +++++-----
>> 7 files changed, 21 insertions(+), 22 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> index 7d16395ede0a..f7e2a878411e 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> @@ -1423,9 +1423,9 @@ static void amdgpu_switcheroo_set_state(struct
>> pci_dev *pdev,
>> /* don't suspend or resume card normally */
>> dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
>> - pci_set_power_state(dev->pdev, PCI_D0);
>> - amdgpu_device_load_pci_state(dev->pdev);
>> - r = pci_enable_device(dev->pdev);
>> + pci_set_power_state(pdev, PCI_D0);
>> + amdgpu_device_load_pci_state(pdev);
>> + r = pci_enable_device(pdev);
>> if (r)
>> DRM_WARN("pci_enable_device failed (%d)\n", r);
>> amdgpu_device_resume(dev, true);
>> @@ -1437,10 +1437,10 @@ static void amdgpu_switcheroo_set_state(struct
>> pci_dev *pdev,
>> drm_kms_helper_poll_disable(dev);
>> dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
>> amdgpu_device_suspend(dev, true);
>> - amdgpu_device_cache_pci_state(dev->pdev);
>> + amdgpu_device_cache_pci_state(pdev);
>> /* Shut down the device */
>> - pci_disable_device(dev->pdev);
>> - pci_set_power_state(dev->pdev, PCI_D3cold);
>> + pci_disable_device(pdev);
>> + pci_set_power_state(pdev, PCI_D3cold);
>> dev->switch_power_state = DRM_SWITCH_POWER_OFF;
>> }
>> }
>> @@ -1703,8 +1703,7 @@ static void
>> amdgpu_device_enable_virtual_display(struct amdgpu_device *adev)
>> adev->enable_virtual_display = false;
>> if (amdgpu_virtual_display) {
>> - struct drm_device *ddev = adev_to_drm(adev);
>> - const char *pci_address_name = pci_name(ddev->pdev);
>> + const char *pci_address_name = pci_name(adev->pdev);
>> char *pciaddstr, *pciaddstr_tmp, *pciaddname_tmp, *pciaddname;
>> pciaddstr = kstrdup(amdgpu_virtual_display, GFP_KERNEL);
>> @@ -3397,7 +3396,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
>> }
>> }
>> - pci_enable_pcie_error_reporting(adev->ddev.pdev);
>> + pci_enable_pcie_error_reporting(adev->pdev);
>> /* Post card if necessary */
>> if (amdgpu_device_need_post(adev)) {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
>> index f764803c53a4..0150a51b65ef 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
>> @@ -926,6 +926,7 @@ amdgpu_display_user_framebuffer_create(struct
>> drm_device *dev,
>> struct drm_file *file_priv,
>> const struct drm_mode_fb_cmd2 *mode_cmd)
>> {
>> + struct amdgpu_device *adev = drm_to_adev(dev);
>> struct drm_gem_object *obj;
>> struct amdgpu_framebuffer *amdgpu_fb;
>> int ret;
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>> index 72efd579ec5e..b4ea67e12ada 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>> @@ -1204,7 +1204,6 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
>> if (ret)
>> return ret;
>> - ddev->pdev = pdev;
>> pci_set_drvdata(pdev, ddev);
>> ret = amdgpu_driver_load_kms(adev, ent->driver_data);
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
>> index 0bf7d36c6686..51cd49c6f38f 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
>> @@ -271,7 +271,7 @@ static int amdgpufb_create(struct drm_fb_helper
>> *helper,
>> DRM_INFO("fb depth is %d\n", fb->format->depth);
>> DRM_INFO(" pitch is %d\n", fb->pitches[0]);
>> - vga_switcheroo_client_fb_set(adev_to_drm(adev)->pdev, info);
>> + vga_switcheroo_client_fb_set(adev->pdev, info);
>> return 0;
>> out:
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
>> index d0a1fee1f5f6..a5c42c3004a0 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
>> @@ -619,7 +619,7 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev,
>> void *data,
>> int r = 0;
>> if (args->va_address < AMDGPU_VA_RESERVED_SIZE) {
>> - dev_dbg(&dev->pdev->dev,
>> + dev_dbg(dev->dev,
>> "va_address 0x%LX is in reserved area 0x%LX\n",
>> args->va_address, AMDGPU_VA_RESERVED_SIZE);
>> return -EINVAL;
>> @@ -627,7 +627,7 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev,
>> void *data,
>> if (args->va_address >= AMDGPU_GMC_HOLE_START &&
>> args->va_address < AMDGPU_GMC_HOLE_END) {
>> - dev_dbg(&dev->pdev->dev,
>> + dev_dbg(dev->dev,
>> "va_address 0x%LX is in VA hole 0x%LX-0x%LX\n",
>> args->va_address, AMDGPU_GMC_HOLE_START,
>> AMDGPU_GMC_HOLE_END);
>> @@ -639,14 +639,14 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev,
>> void *data,
>> vm_size = adev->vm_manager.max_pfn * AMDGPU_GPU_PAGE_SIZE;
>> vm_size -= AMDGPU_VA_RESERVED_SIZE;
>> if (args->va_address + args->map_size > vm_size) {
>> - dev_dbg(&dev->pdev->dev,
>> + dev_dbg(dev->dev,
>> "va_address 0x%llx is in top reserved area 0x%llx\n",
>> args->va_address + args->map_size, vm_size);
>> return -EINVAL;
>> }
>> if ((args->flags & ~valid_flags) && (args->flags & ~prt_flags)) {
>> - dev_dbg(&dev->pdev->dev, "invalid flags combination 0x%08X\n",
>> + dev_dbg(dev->dev, "invalid flags combination 0x%08X\n",
>> args->flags);
>> return -EINVAL;
>> }
>> @@ -658,7 +658,7 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev,
>> void *data,
>> case AMDGPU_VA_OP_REPLACE:
>> break;
>> default:
>> - dev_dbg(&dev->pdev->dev, "unsupported operation %d\n",
>> + dev_dbg(dev->dev, "unsupported operation %d\n",
>> args->operation);
>> return -EINVAL;
>> }
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
>> index 47cad23a6b9e..bca4dddd5a15 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
>> @@ -176,7 +176,7 @@ struct amdgpu_i2c_chan *amdgpu_i2c_create(struct
>> drm_device *dev,
>> i2c->rec = *rec;
>> i2c->adapter.owner = THIS_MODULE;
>> i2c->adapter.class = I2C_CLASS_DDC;
>> - i2c->adapter.dev.parent = &dev->pdev->dev;
>> + i2c->adapter.dev.parent = dev->dev;
>> i2c->dev = dev;
>> i2c_set_adapdata(&i2c->adapter, i2c);
>> mutex_init(&i2c->mutex);
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
>> index b16b32797624..3c37cf1ae8b7 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
>> @@ -142,7 +142,7 @@ int amdgpu_driver_load_kms(struct amdgpu_device
>> *adev, unsigned long flags)
>> (amdgpu_is_atpx_hybrid() ||
>> amdgpu_has_atpx_dgpu_power_cntl()) &&
>> ((flags & AMD_IS_APU) == 0) &&
>> - !pci_is_thunderbolt_attached(dev->pdev))
>> + !pci_is_thunderbolt_attached(to_pci_dev(dev->dev)))
>> flags |= AMD_IS_PX;
>> parent = pci_upstream_bridge(adev->pdev);
>> @@ -156,7 +156,7 @@ int amdgpu_driver_load_kms(struct amdgpu_device
>> *adev, unsigned long flags)
>> */
>> r = amdgpu_device_init(adev, flags);
>> if (r) {
>> - dev_err(&dev->pdev->dev, "Fatal error during GPU init\n");
>> + dev_err(dev->dev, "Fatal error during GPU init\n");
>> goto out;
>> }
>> @@ -199,7 +199,7 @@ int amdgpu_driver_load_kms(struct amdgpu_device
>> *adev, unsigned long flags)
>> acpi_status = amdgpu_acpi_init(adev);
>> if (acpi_status)
>> - dev_dbg(&dev->pdev->dev, "Error during ACPI methods call\n");
>> + dev_dbg(dev->dev, "Error during ACPI methods call\n");
>> if (adev->runpm) {
>> /* only need to skip on ATPX */
>> @@ -735,10 +735,10 @@ int amdgpu_info_ioctl(struct drm_device *dev,
>> void *data, struct drm_file *filp)
>> if (!dev_info)
>> return -ENOMEM;
>> - dev_info->device_id = dev->pdev->device;
>> + dev_info->device_id = adev->pdev->device;
>> dev_info->chip_rev = adev->rev_id;
>> dev_info->external_rev = adev->external_rev_id;
>> - dev_info->pci_rev = dev->pdev->revision;
>> + dev_info->pci_rev = adev->pdev->revision;
>> dev_info->family = adev->family;
>> dev_info->num_shader_engines =
>> adev->gfx.config.max_shader_engines;
>> dev_info->num_shader_arrays_per_engine =
>> adev->gfx.config.max_sh_per_se;
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [Intel-gfx] [PATCH v3 2/8] drm/amdgpu: Remove references to struct drm_device.pdev
2021-01-18 14:40 ` Thomas Zimmermann
@ 2021-01-18 14:56 ` Daniel Vetter
2021-01-18 15:02 ` Thomas Zimmermann
0 siblings, 1 reply; 20+ messages in thread
From: Daniel Vetter @ 2021-01-18 14:56 UTC (permalink / raw)
To: Thomas Zimmermann
Cc: intel-gvt-dev, amd-gfx list, Dave Airlie, Nouveau Dev, intel-gfx,
dri-devel, Alex Deucher, Sam Ravnborg, Christian König
On Mon, Jan 18, 2021 at 3:40 PM Thomas Zimmermann <tzimmermann@suse.de> wrote:
>
> Hi
>
> Am 18.01.21 um 14:50 schrieb Christian König:
> > Hi Thomas,
> >
> > this patch unfortunately completely broke amdgpu.
> >
> > See the splat below:
> >
> > [ 74.553881]
> > ==================================================================
> > [ 74.554060] BUG: KASAN: null-ptr-deref in
> > drm_pci_set_busid+0x38/0x100 [drm]
> > [ 74.554393] Read of size 4 at addr 0000000000000038 by task Xorg/1115
> >
> > [ 74.554585] CPU: 6 PID: 1115 Comm: Xorg Not tainted 5.11.0-rc2+ #75
> > [ 74.554594] Hardware name: System manufacturer System Product
> > Name/PRIME X399-A, BIOS 0808 10/12/2018
> > [ 74.554600] Call Trace:
> > [ 74.554605] dump_stack+0x9d/0xce
> > [ 74.554616] ? drm_pci_set_busid+0x38/0x100 [drm]
> > [ 74.554787] kasan_report.cold+0x5d/0xd1
> > [ 74.554799] ? drm_pci_set_busid+0x38/0x100 [drm]
> > [ 74.554969] __asan_load4+0x6b/0x90
> > [ 74.554978] drm_pci_set_busid+0x38/0x100 [drm]
> > [ 74.555148] drm_setversion+0x2ce/0x350 [drm]
> > [ 74.555315] ? drm_is_current_master+0x5d/0x70 [drm]
> > [ 74.555481] drm_ioctl_kernel+0x16d/0x1c0 [drm]
> > [ 74.555648] ? drm_ioctl_permit+0xb0/0xb0 [drm]
> > [ 74.555811] ? drm_setversion+0x350/0x350 [drm]
> > [ 74.555973] ? check_stack_object+0x2d/0xb0
> > [ 74.555985] drm_ioctl+0x363/0x5a0 [drm]
> > [ 74.556147] ? drm_ioctl_permit+0xb0/0xb0 [drm]
> > [ 74.556310] ? drm_ioctl_kernel+0x1c0/0x1c0 [drm]
> > [ 74.556473] ? __kasan_check_write+0x14/0x20
> > [ 74.556481] ? _raw_spin_lock_irqsave+0x8e/0xf0
> > [ 74.556492] ? _raw_spin_trylock_bh+0x100/0x100
> > [ 74.556504] amdgpu_drm_ioctl+0x7e/0xd0 [amdgpu]
> > [ 74.557409] __x64_sys_ioctl+0xc3/0x100
> > [ 74.557418] do_syscall_64+0x38/0x90
> > [ 74.557427] entry_SYSCALL_64_after_hwframe+0x44/0xa9
> >
> > Any idea what's going wrong here?
>
> I meanwhile posted an updated patchset with a fix in patch 1. [1] Maybe
> you can apply this one and test.
>
> The original bug report and testing is at [2]. Apparently, DRM core has
> to be changed together with drivers. I'm honestly not sure why.
Same thing Chris pointed out on the i915 patch: If drivers stop
setting drm->pdev, but core still uses it, we have booms. So that
patch 1 needs to land asap I think.
-Daniel
>
> Best regards
> Thomas
>
> [1]
> https://lore.kernel.org/dri-devel/20210118131420.15874-1-tzimmermann@suse.de/T/#m8a0cdf02375a4e23e194d2e7eb80e8738632ea84
> [2]
> https://lore.kernel.org/dri-devel/7851c78c-8c57-3c84-cd49-a72703095a5d@suse.de/
>
> >
> > Thanks in advance,
> > Christian.
> >
> > Am 07.01.21 um 09:07 schrieb Thomas Zimmermann:
> >> Using struct drm_device.pdev is deprecated. Convert amdgpu to struct
> >> drm_device.dev. No functional changes.
> >>
> >> v3:
> >> * rebased
> >>
> >> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> >> Acked-by: Christian König <christian.koenig@amd.com>
> >> Acked-by: Alex Deucher <alexander.deucher@amd.com>
> >> Acked-by: Sam Ravnborg <sam@ravnborg.org>
> >> Cc: Alex Deucher <alexander.deucher@amd.com>
> >> Cc: Christian König <christian.koenig@amd.com>
> >> ---
> >> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 17 ++++++++---------
> >> drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 1 +
> >> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 -
> >> drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 2 +-
> >> drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 10 +++++-----
> >> drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c | 2 +-
> >> drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 10 +++++-----
> >> 7 files changed, 21 insertions(+), 22 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> >> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> >> index 7d16395ede0a..f7e2a878411e 100644
> >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> >> @@ -1423,9 +1423,9 @@ static void amdgpu_switcheroo_set_state(struct
> >> pci_dev *pdev,
> >> /* don't suspend or resume card normally */
> >> dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
> >> - pci_set_power_state(dev->pdev, PCI_D0);
> >> - amdgpu_device_load_pci_state(dev->pdev);
> >> - r = pci_enable_device(dev->pdev);
> >> + pci_set_power_state(pdev, PCI_D0);
> >> + amdgpu_device_load_pci_state(pdev);
> >> + r = pci_enable_device(pdev);
> >> if (r)
> >> DRM_WARN("pci_enable_device failed (%d)\n", r);
> >> amdgpu_device_resume(dev, true);
> >> @@ -1437,10 +1437,10 @@ static void amdgpu_switcheroo_set_state(struct
> >> pci_dev *pdev,
> >> drm_kms_helper_poll_disable(dev);
> >> dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
> >> amdgpu_device_suspend(dev, true);
> >> - amdgpu_device_cache_pci_state(dev->pdev);
> >> + amdgpu_device_cache_pci_state(pdev);
> >> /* Shut down the device */
> >> - pci_disable_device(dev->pdev);
> >> - pci_set_power_state(dev->pdev, PCI_D3cold);
> >> + pci_disable_device(pdev);
> >> + pci_set_power_state(pdev, PCI_D3cold);
> >> dev->switch_power_state = DRM_SWITCH_POWER_OFF;
> >> }
> >> }
> >> @@ -1703,8 +1703,7 @@ static void
> >> amdgpu_device_enable_virtual_display(struct amdgpu_device *adev)
> >> adev->enable_virtual_display = false;
> >> if (amdgpu_virtual_display) {
> >> - struct drm_device *ddev = adev_to_drm(adev);
> >> - const char *pci_address_name = pci_name(ddev->pdev);
> >> + const char *pci_address_name = pci_name(adev->pdev);
> >> char *pciaddstr, *pciaddstr_tmp, *pciaddname_tmp, *pciaddname;
> >> pciaddstr = kstrdup(amdgpu_virtual_display, GFP_KERNEL);
> >> @@ -3397,7 +3396,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
> >> }
> >> }
> >> - pci_enable_pcie_error_reporting(adev->ddev.pdev);
> >> + pci_enable_pcie_error_reporting(adev->pdev);
> >> /* Post card if necessary */
> >> if (amdgpu_device_need_post(adev)) {
> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> >> b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> >> index f764803c53a4..0150a51b65ef 100644
> >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> >> @@ -926,6 +926,7 @@ amdgpu_display_user_framebuffer_create(struct
> >> drm_device *dev,
> >> struct drm_file *file_priv,
> >> const struct drm_mode_fb_cmd2 *mode_cmd)
> >> {
> >> + struct amdgpu_device *adev = drm_to_adev(dev);
> >> struct drm_gem_object *obj;
> >> struct amdgpu_framebuffer *amdgpu_fb;
> >> int ret;
> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> >> b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> >> index 72efd579ec5e..b4ea67e12ada 100644
> >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> >> @@ -1204,7 +1204,6 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
> >> if (ret)
> >> return ret;
> >> - ddev->pdev = pdev;
> >> pci_set_drvdata(pdev, ddev);
> >> ret = amdgpu_driver_load_kms(adev, ent->driver_data);
> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
> >> b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
> >> index 0bf7d36c6686..51cd49c6f38f 100644
> >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
> >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
> >> @@ -271,7 +271,7 @@ static int amdgpufb_create(struct drm_fb_helper
> >> *helper,
> >> DRM_INFO("fb depth is %d\n", fb->format->depth);
> >> DRM_INFO(" pitch is %d\n", fb->pitches[0]);
> >> - vga_switcheroo_client_fb_set(adev_to_drm(adev)->pdev, info);
> >> + vga_switcheroo_client_fb_set(adev->pdev, info);
> >> return 0;
> >> out:
> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> >> b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> >> index d0a1fee1f5f6..a5c42c3004a0 100644
> >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> >> @@ -619,7 +619,7 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev,
> >> void *data,
> >> int r = 0;
> >> if (args->va_address < AMDGPU_VA_RESERVED_SIZE) {
> >> - dev_dbg(&dev->pdev->dev,
> >> + dev_dbg(dev->dev,
> >> "va_address 0x%LX is in reserved area 0x%LX\n",
> >> args->va_address, AMDGPU_VA_RESERVED_SIZE);
> >> return -EINVAL;
> >> @@ -627,7 +627,7 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev,
> >> void *data,
> >> if (args->va_address >= AMDGPU_GMC_HOLE_START &&
> >> args->va_address < AMDGPU_GMC_HOLE_END) {
> >> - dev_dbg(&dev->pdev->dev,
> >> + dev_dbg(dev->dev,
> >> "va_address 0x%LX is in VA hole 0x%LX-0x%LX\n",
> >> args->va_address, AMDGPU_GMC_HOLE_START,
> >> AMDGPU_GMC_HOLE_END);
> >> @@ -639,14 +639,14 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev,
> >> void *data,
> >> vm_size = adev->vm_manager.max_pfn * AMDGPU_GPU_PAGE_SIZE;
> >> vm_size -= AMDGPU_VA_RESERVED_SIZE;
> >> if (args->va_address + args->map_size > vm_size) {
> >> - dev_dbg(&dev->pdev->dev,
> >> + dev_dbg(dev->dev,
> >> "va_address 0x%llx is in top reserved area 0x%llx\n",
> >> args->va_address + args->map_size, vm_size);
> >> return -EINVAL;
> >> }
> >> if ((args->flags & ~valid_flags) && (args->flags & ~prt_flags)) {
> >> - dev_dbg(&dev->pdev->dev, "invalid flags combination 0x%08X\n",
> >> + dev_dbg(dev->dev, "invalid flags combination 0x%08X\n",
> >> args->flags);
> >> return -EINVAL;
> >> }
> >> @@ -658,7 +658,7 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev,
> >> void *data,
> >> case AMDGPU_VA_OP_REPLACE:
> >> break;
> >> default:
> >> - dev_dbg(&dev->pdev->dev, "unsupported operation %d\n",
> >> + dev_dbg(dev->dev, "unsupported operation %d\n",
> >> args->operation);
> >> return -EINVAL;
> >> }
> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
> >> b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
> >> index 47cad23a6b9e..bca4dddd5a15 100644
> >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
> >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
> >> @@ -176,7 +176,7 @@ struct amdgpu_i2c_chan *amdgpu_i2c_create(struct
> >> drm_device *dev,
> >> i2c->rec = *rec;
> >> i2c->adapter.owner = THIS_MODULE;
> >> i2c->adapter.class = I2C_CLASS_DDC;
> >> - i2c->adapter.dev.parent = &dev->pdev->dev;
> >> + i2c->adapter.dev.parent = dev->dev;
> >> i2c->dev = dev;
> >> i2c_set_adapdata(&i2c->adapter, i2c);
> >> mutex_init(&i2c->mutex);
> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> >> b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> >> index b16b32797624..3c37cf1ae8b7 100644
> >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> >> @@ -142,7 +142,7 @@ int amdgpu_driver_load_kms(struct amdgpu_device
> >> *adev, unsigned long flags)
> >> (amdgpu_is_atpx_hybrid() ||
> >> amdgpu_has_atpx_dgpu_power_cntl()) &&
> >> ((flags & AMD_IS_APU) == 0) &&
> >> - !pci_is_thunderbolt_attached(dev->pdev))
> >> + !pci_is_thunderbolt_attached(to_pci_dev(dev->dev)))
> >> flags |= AMD_IS_PX;
> >> parent = pci_upstream_bridge(adev->pdev);
> >> @@ -156,7 +156,7 @@ int amdgpu_driver_load_kms(struct amdgpu_device
> >> *adev, unsigned long flags)
> >> */
> >> r = amdgpu_device_init(adev, flags);
> >> if (r) {
> >> - dev_err(&dev->pdev->dev, "Fatal error during GPU init\n");
> >> + dev_err(dev->dev, "Fatal error during GPU init\n");
> >> goto out;
> >> }
> >> @@ -199,7 +199,7 @@ int amdgpu_driver_load_kms(struct amdgpu_device
> >> *adev, unsigned long flags)
> >> acpi_status = amdgpu_acpi_init(adev);
> >> if (acpi_status)
> >> - dev_dbg(&dev->pdev->dev, "Error during ACPI methods call\n");
> >> + dev_dbg(dev->dev, "Error during ACPI methods call\n");
> >> if (adev->runpm) {
> >> /* only need to skip on ATPX */
> >> @@ -735,10 +735,10 @@ int amdgpu_info_ioctl(struct drm_device *dev,
> >> void *data, struct drm_file *filp)
> >> if (!dev_info)
> >> return -ENOMEM;
> >> - dev_info->device_id = dev->pdev->device;
> >> + dev_info->device_id = adev->pdev->device;
> >> dev_info->chip_rev = adev->rev_id;
> >> dev_info->external_rev = adev->external_rev_id;
> >> - dev_info->pci_rev = dev->pdev->revision;
> >> + dev_info->pci_rev = adev->pdev->revision;
> >> dev_info->family = adev->family;
> >> dev_info->num_shader_engines =
> >> adev->gfx.config.max_shader_engines;
> >> dev_info->num_shader_arrays_per_engine =
> >> adev->gfx.config.max_sh_per_se;
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
> --
> Thomas Zimmermann
> Graphics Driver Developer
> SUSE Software Solutions Germany GmbH
> Maxfeldstr. 5, 90409 Nürnberg, Germany
> (HRB 36809, AG Nürnberg)
> Geschäftsführer: Felix Imendörffer
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [Intel-gfx] [PATCH v3 2/8] drm/amdgpu: Remove references to struct drm_device.pdev
2021-01-18 14:56 ` Daniel Vetter
@ 2021-01-18 15:02 ` Thomas Zimmermann
0 siblings, 0 replies; 20+ messages in thread
From: Thomas Zimmermann @ 2021-01-18 15:02 UTC (permalink / raw)
To: Daniel Vetter
Cc: intel-gvt-dev, amd-gfx list, Dave Airlie, Nouveau Dev, intel-gfx,
dri-devel, Alex Deucher, Sam Ravnborg, Christian König
[-- Attachment #1.1.1: Type: text/plain, Size: 14449 bytes --]
Hi
Am 18.01.21 um 15:56 schrieb Daniel Vetter:
> On Mon, Jan 18, 2021 at 3:40 PM Thomas Zimmermann <tzimmermann@suse.de> wrote:
>>
>> Hi
>>
>> Am 18.01.21 um 14:50 schrieb Christian König:
>>> Hi Thomas,
>>>
>>> this patch unfortunately completely broke amdgpu.
>>>
>>> See the splat below:
>>>
>>> [ 74.553881]
>>> ==================================================================
>>> [ 74.554060] BUG: KASAN: null-ptr-deref in
>>> drm_pci_set_busid+0x38/0x100 [drm]
>>> [ 74.554393] Read of size 4 at addr 0000000000000038 by task Xorg/1115
>>>
>>> [ 74.554585] CPU: 6 PID: 1115 Comm: Xorg Not tainted 5.11.0-rc2+ #75
>>> [ 74.554594] Hardware name: System manufacturer System Product
>>> Name/PRIME X399-A, BIOS 0808 10/12/2018
>>> [ 74.554600] Call Trace:
>>> [ 74.554605] dump_stack+0x9d/0xce
>>> [ 74.554616] ? drm_pci_set_busid+0x38/0x100 [drm]
>>> [ 74.554787] kasan_report.cold+0x5d/0xd1
>>> [ 74.554799] ? drm_pci_set_busid+0x38/0x100 [drm]
>>> [ 74.554969] __asan_load4+0x6b/0x90
>>> [ 74.554978] drm_pci_set_busid+0x38/0x100 [drm]
>>> [ 74.555148] drm_setversion+0x2ce/0x350 [drm]
>>> [ 74.555315] ? drm_is_current_master+0x5d/0x70 [drm]
>>> [ 74.555481] drm_ioctl_kernel+0x16d/0x1c0 [drm]
>>> [ 74.555648] ? drm_ioctl_permit+0xb0/0xb0 [drm]
>>> [ 74.555811] ? drm_setversion+0x350/0x350 [drm]
>>> [ 74.555973] ? check_stack_object+0x2d/0xb0
>>> [ 74.555985] drm_ioctl+0x363/0x5a0 [drm]
>>> [ 74.556147] ? drm_ioctl_permit+0xb0/0xb0 [drm]
>>> [ 74.556310] ? drm_ioctl_kernel+0x1c0/0x1c0 [drm]
>>> [ 74.556473] ? __kasan_check_write+0x14/0x20
>>> [ 74.556481] ? _raw_spin_lock_irqsave+0x8e/0xf0
>>> [ 74.556492] ? _raw_spin_trylock_bh+0x100/0x100
>>> [ 74.556504] amdgpu_drm_ioctl+0x7e/0xd0 [amdgpu]
>>> [ 74.557409] __x64_sys_ioctl+0xc3/0x100
>>> [ 74.557418] do_syscall_64+0x38/0x90
>>> [ 74.557427] entry_SYSCALL_64_after_hwframe+0x44/0xa9
>>>
>>> Any idea what's going wrong here?
>>
>> I meanwhile posted an updated patchset with a fix in patch 1. [1] Maybe
>> you can apply this one and test.
>>
>> The original bug report and testing is at [2]. Apparently, DRM core has
>> to be changed together with drivers. I'm honestly not sure why.
>
> Same thing Chris pointed out on the i915 patch: If drivers stop
> setting drm->pdev, but core still uses it, we have booms. So that
> patch 1 needs to land asap I think.
Yep. But somehow my impression was that the DRM core also sets pdev
internally in drm_get_pci_dev(). But looking at it now, that code is
only used by legacy drivers. :/
Best regards
Thomas
> -Daniel
>
>>
>> Best regards
>> Thomas
>>
>> [1]
>> https://lore.kernel.org/dri-devel/20210118131420.15874-1-tzimmermann@suse.de/T/#m8a0cdf02375a4e23e194d2e7eb80e8738632ea84
>> [2]
>> https://lore.kernel.org/dri-devel/7851c78c-8c57-3c84-cd49-a72703095a5d@suse.de/
>>
>>>
>>> Thanks in advance,
>>> Christian.
>>>
>>> Am 07.01.21 um 09:07 schrieb Thomas Zimmermann:
>>>> Using struct drm_device.pdev is deprecated. Convert amdgpu to struct
>>>> drm_device.dev. No functional changes.
>>>>
>>>> v3:
>>>> * rebased
>>>>
>>>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>>>> Acked-by: Christian König <christian.koenig@amd.com>
>>>> Acked-by: Alex Deucher <alexander.deucher@amd.com>
>>>> Acked-by: Sam Ravnborg <sam@ravnborg.org>
>>>> Cc: Alex Deucher <alexander.deucher@amd.com>
>>>> Cc: Christian König <christian.koenig@amd.com>
>>>> ---
>>>> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 17 ++++++++---------
>>>> drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 1 +
>>>> drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 -
>>>> drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 2 +-
>>>> drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 10 +++++-----
>>>> drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c | 2 +-
>>>> drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 10 +++++-----
>>>> 7 files changed, 21 insertions(+), 22 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>>>> index 7d16395ede0a..f7e2a878411e 100644
>>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>>>> @@ -1423,9 +1423,9 @@ static void amdgpu_switcheroo_set_state(struct
>>>> pci_dev *pdev,
>>>> /* don't suspend or resume card normally */
>>>> dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
>>>> - pci_set_power_state(dev->pdev, PCI_D0);
>>>> - amdgpu_device_load_pci_state(dev->pdev);
>>>> - r = pci_enable_device(dev->pdev);
>>>> + pci_set_power_state(pdev, PCI_D0);
>>>> + amdgpu_device_load_pci_state(pdev);
>>>> + r = pci_enable_device(pdev);
>>>> if (r)
>>>> DRM_WARN("pci_enable_device failed (%d)\n", r);
>>>> amdgpu_device_resume(dev, true);
>>>> @@ -1437,10 +1437,10 @@ static void amdgpu_switcheroo_set_state(struct
>>>> pci_dev *pdev,
>>>> drm_kms_helper_poll_disable(dev);
>>>> dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
>>>> amdgpu_device_suspend(dev, true);
>>>> - amdgpu_device_cache_pci_state(dev->pdev);
>>>> + amdgpu_device_cache_pci_state(pdev);
>>>> /* Shut down the device */
>>>> - pci_disable_device(dev->pdev);
>>>> - pci_set_power_state(dev->pdev, PCI_D3cold);
>>>> + pci_disable_device(pdev);
>>>> + pci_set_power_state(pdev, PCI_D3cold);
>>>> dev->switch_power_state = DRM_SWITCH_POWER_OFF;
>>>> }
>>>> }
>>>> @@ -1703,8 +1703,7 @@ static void
>>>> amdgpu_device_enable_virtual_display(struct amdgpu_device *adev)
>>>> adev->enable_virtual_display = false;
>>>> if (amdgpu_virtual_display) {
>>>> - struct drm_device *ddev = adev_to_drm(adev);
>>>> - const char *pci_address_name = pci_name(ddev->pdev);
>>>> + const char *pci_address_name = pci_name(adev->pdev);
>>>> char *pciaddstr, *pciaddstr_tmp, *pciaddname_tmp, *pciaddname;
>>>> pciaddstr = kstrdup(amdgpu_virtual_display, GFP_KERNEL);
>>>> @@ -3397,7 +3396,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
>>>> }
>>>> }
>>>> - pci_enable_pcie_error_reporting(adev->ddev.pdev);
>>>> + pci_enable_pcie_error_reporting(adev->pdev);
>>>> /* Post card if necessary */
>>>> if (amdgpu_device_need_post(adev)) {
>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
>>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
>>>> index f764803c53a4..0150a51b65ef 100644
>>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
>>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
>>>> @@ -926,6 +926,7 @@ amdgpu_display_user_framebuffer_create(struct
>>>> drm_device *dev,
>>>> struct drm_file *file_priv,
>>>> const struct drm_mode_fb_cmd2 *mode_cmd)
>>>> {
>>>> + struct amdgpu_device *adev = drm_to_adev(dev);
>>>> struct drm_gem_object *obj;
>>>> struct amdgpu_framebuffer *amdgpu_fb;
>>>> int ret;
>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>>>> index 72efd579ec5e..b4ea67e12ada 100644
>>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>>>> @@ -1204,7 +1204,6 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
>>>> if (ret)
>>>> return ret;
>>>> - ddev->pdev = pdev;
>>>> pci_set_drvdata(pdev, ddev);
>>>> ret = amdgpu_driver_load_kms(adev, ent->driver_data);
>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
>>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
>>>> index 0bf7d36c6686..51cd49c6f38f 100644
>>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
>>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
>>>> @@ -271,7 +271,7 @@ static int amdgpufb_create(struct drm_fb_helper
>>>> *helper,
>>>> DRM_INFO("fb depth is %d\n", fb->format->depth);
>>>> DRM_INFO(" pitch is %d\n", fb->pitches[0]);
>>>> - vga_switcheroo_client_fb_set(adev_to_drm(adev)->pdev, info);
>>>> + vga_switcheroo_client_fb_set(adev->pdev, info);
>>>> return 0;
>>>> out:
>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
>>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
>>>> index d0a1fee1f5f6..a5c42c3004a0 100644
>>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
>>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
>>>> @@ -619,7 +619,7 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev,
>>>> void *data,
>>>> int r = 0;
>>>> if (args->va_address < AMDGPU_VA_RESERVED_SIZE) {
>>>> - dev_dbg(&dev->pdev->dev,
>>>> + dev_dbg(dev->dev,
>>>> "va_address 0x%LX is in reserved area 0x%LX\n",
>>>> args->va_address, AMDGPU_VA_RESERVED_SIZE);
>>>> return -EINVAL;
>>>> @@ -627,7 +627,7 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev,
>>>> void *data,
>>>> if (args->va_address >= AMDGPU_GMC_HOLE_START &&
>>>> args->va_address < AMDGPU_GMC_HOLE_END) {
>>>> - dev_dbg(&dev->pdev->dev,
>>>> + dev_dbg(dev->dev,
>>>> "va_address 0x%LX is in VA hole 0x%LX-0x%LX\n",
>>>> args->va_address, AMDGPU_GMC_HOLE_START,
>>>> AMDGPU_GMC_HOLE_END);
>>>> @@ -639,14 +639,14 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev,
>>>> void *data,
>>>> vm_size = adev->vm_manager.max_pfn * AMDGPU_GPU_PAGE_SIZE;
>>>> vm_size -= AMDGPU_VA_RESERVED_SIZE;
>>>> if (args->va_address + args->map_size > vm_size) {
>>>> - dev_dbg(&dev->pdev->dev,
>>>> + dev_dbg(dev->dev,
>>>> "va_address 0x%llx is in top reserved area 0x%llx\n",
>>>> args->va_address + args->map_size, vm_size);
>>>> return -EINVAL;
>>>> }
>>>> if ((args->flags & ~valid_flags) && (args->flags & ~prt_flags)) {
>>>> - dev_dbg(&dev->pdev->dev, "invalid flags combination 0x%08X\n",
>>>> + dev_dbg(dev->dev, "invalid flags combination 0x%08X\n",
>>>> args->flags);
>>>> return -EINVAL;
>>>> }
>>>> @@ -658,7 +658,7 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev,
>>>> void *data,
>>>> case AMDGPU_VA_OP_REPLACE:
>>>> break;
>>>> default:
>>>> - dev_dbg(&dev->pdev->dev, "unsupported operation %d\n",
>>>> + dev_dbg(dev->dev, "unsupported operation %d\n",
>>>> args->operation);
>>>> return -EINVAL;
>>>> }
>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
>>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
>>>> index 47cad23a6b9e..bca4dddd5a15 100644
>>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
>>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
>>>> @@ -176,7 +176,7 @@ struct amdgpu_i2c_chan *amdgpu_i2c_create(struct
>>>> drm_device *dev,
>>>> i2c->rec = *rec;
>>>> i2c->adapter.owner = THIS_MODULE;
>>>> i2c->adapter.class = I2C_CLASS_DDC;
>>>> - i2c->adapter.dev.parent = &dev->pdev->dev;
>>>> + i2c->adapter.dev.parent = dev->dev;
>>>> i2c->dev = dev;
>>>> i2c_set_adapdata(&i2c->adapter, i2c);
>>>> mutex_init(&i2c->mutex);
>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
>>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
>>>> index b16b32797624..3c37cf1ae8b7 100644
>>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
>>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
>>>> @@ -142,7 +142,7 @@ int amdgpu_driver_load_kms(struct amdgpu_device
>>>> *adev, unsigned long flags)
>>>> (amdgpu_is_atpx_hybrid() ||
>>>> amdgpu_has_atpx_dgpu_power_cntl()) &&
>>>> ((flags & AMD_IS_APU) == 0) &&
>>>> - !pci_is_thunderbolt_attached(dev->pdev))
>>>> + !pci_is_thunderbolt_attached(to_pci_dev(dev->dev)))
>>>> flags |= AMD_IS_PX;
>>>> parent = pci_upstream_bridge(adev->pdev);
>>>> @@ -156,7 +156,7 @@ int amdgpu_driver_load_kms(struct amdgpu_device
>>>> *adev, unsigned long flags)
>>>> */
>>>> r = amdgpu_device_init(adev, flags);
>>>> if (r) {
>>>> - dev_err(&dev->pdev->dev, "Fatal error during GPU init\n");
>>>> + dev_err(dev->dev, "Fatal error during GPU init\n");
>>>> goto out;
>>>> }
>>>> @@ -199,7 +199,7 @@ int amdgpu_driver_load_kms(struct amdgpu_device
>>>> *adev, unsigned long flags)
>>>> acpi_status = amdgpu_acpi_init(adev);
>>>> if (acpi_status)
>>>> - dev_dbg(&dev->pdev->dev, "Error during ACPI methods call\n");
>>>> + dev_dbg(dev->dev, "Error during ACPI methods call\n");
>>>> if (adev->runpm) {
>>>> /* only need to skip on ATPX */
>>>> @@ -735,10 +735,10 @@ int amdgpu_info_ioctl(struct drm_device *dev,
>>>> void *data, struct drm_file *filp)
>>>> if (!dev_info)
>>>> return -ENOMEM;
>>>> - dev_info->device_id = dev->pdev->device;
>>>> + dev_info->device_id = adev->pdev->device;
>>>> dev_info->chip_rev = adev->rev_id;
>>>> dev_info->external_rev = adev->external_rev_id;
>>>> - dev_info->pci_rev = dev->pdev->revision;
>>>> + dev_info->pci_rev = adev->pdev->revision;
>>>> dev_info->family = adev->family;
>>>> dev_info->num_shader_engines =
>>>> adev->gfx.config.max_shader_engines;
>>>> dev_info->num_shader_arrays_per_engine =
>>>> adev->gfx.config.max_sh_per_se;
>>>
>>> _______________________________________________
>>> dri-devel mailing list
>>> dri-devel@lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>>
>> --
>> Thomas Zimmermann
>> Graphics Driver Developer
>> SUSE Software Solutions Germany GmbH
>> Maxfeldstr. 5, 90409 Nürnberg, Germany
>> (HRB 36809, AG Nürnberg)
>> Geschäftsführer: Felix Imendörffer
>>
>
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2021-01-18 15:02 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-07 8:07 [Intel-gfx] [PATCH v3 0/8] drm: Move struct drm_device.pdev to legacy Thomas Zimmermann
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 1/8] drm/amdgpu: Fix trailing whitespaces Thomas Zimmermann
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 2/8] drm/amdgpu: Remove references to struct drm_device.pdev Thomas Zimmermann
2021-01-18 13:50 ` Christian König
2021-01-18 14:40 ` Thomas Zimmermann
2021-01-18 14:56 ` Daniel Vetter
2021-01-18 15:02 ` Thomas Zimmermann
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 3/8] drm/hibmc: " Thomas Zimmermann
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 4/8] drm/i915: " Thomas Zimmermann
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 5/8] drm/i915/gt: " Thomas Zimmermann
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 6/8] drm/i915/gvt: " Thomas Zimmermann
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 7/8] drm/nouveau: " Thomas Zimmermann
2021-01-07 8:07 ` [Intel-gfx] [PATCH v3 8/8] drm: Upcast struct drm_device.dev to struct pci_device; replace pdev Thomas Zimmermann
2021-01-07 9:45 ` kernel test robot
2021-01-07 10:45 ` Thomas Zimmermann
2021-01-08 1:25 ` [Intel-gfx] [kbuild-all] " Rong Chen
2021-01-08 8:04 ` Thomas Zimmermann
2021-01-08 9:02 ` Daniel Vetter
2021-01-07 9:47 ` [Intel-gfx] " kernel test robot
2021-01-07 15:33 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm: Move struct drm_device.pdev to legacy (rev3) Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).