mbox series

[v7,0/4] drm: Move struct drm_device.pdev to legacy

Message ID 20210427111421.2386-1-tzimmermann@suse.de (mailing list archive)
Headers show
Series drm: Move struct drm_device.pdev to legacy | expand

Message

Thomas Zimmermann April 27, 2021, 11:14 a.m. UTC
V7 of the patchset fixes some bitrot in the intel driver.

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.

v7:
	* fix instances of pdev that have benn added under i915/
v6:
	* also remove assignment in i915/selftests in later patch (Chris)
v5:
	* remove assignment in later patch (Chris)
v4:
	* merged several patches
	* moved core changes into separate patch
	* vmwgfx build fix
v3:
	* merged several patches
	* 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 (4):
  drm/i915/gt: Remove reference to struct drm_device.pdev
  drm/i915: Remove reference to struct drm_device.pdev
  drm/i915: Don't assign to struct drm_device.pdev
  drm: Move struct drm_device.pdev to legacy section

 drivers/gpu/drm/i915/gt/intel_region_lmem.c      | 2 +-
 drivers/gpu/drm/i915/i915_drv.c                  | 1 -
 drivers/gpu/drm/i915/intel_runtime_pm.h          | 2 +-
 drivers/gpu/drm/i915/selftests/mock_gem_device.c | 1 -
 include/drm/drm_device.h                         | 6 +++---
 5 files changed, 5 insertions(+), 7 deletions(-)

--
2.31.1

Comments

Jani Nikula April 27, 2021, 12:04 p.m. UTC | #1
On Tue, 27 Apr 2021, Thomas Zimmermann <tzimmermann@suse.de> wrote:
> V7 of the patchset fixes some bitrot in the intel driver.
>
> 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.

On the series,

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

How should we merge these?



>
> v7:
> 	* fix instances of pdev that have benn added under i915/
> v6:
> 	* also remove assignment in i915/selftests in later patch (Chris)
> v5:
> 	* remove assignment in later patch (Chris)
> v4:
> 	* merged several patches
> 	* moved core changes into separate patch
> 	* vmwgfx build fix
> v3:
> 	* merged several patches
> 	* 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 (4):
>   drm/i915/gt: Remove reference to struct drm_device.pdev
>   drm/i915: Remove reference to struct drm_device.pdev
>   drm/i915: Don't assign to struct drm_device.pdev
>   drm: Move struct drm_device.pdev to legacy section
>
>  drivers/gpu/drm/i915/gt/intel_region_lmem.c      | 2 +-
>  drivers/gpu/drm/i915/i915_drv.c                  | 1 -
>  drivers/gpu/drm/i915/intel_runtime_pm.h          | 2 +-
>  drivers/gpu/drm/i915/selftests/mock_gem_device.c | 1 -
>  include/drm/drm_device.h                         | 6 +++---
>  5 files changed, 5 insertions(+), 7 deletions(-)
>
> --
> 2.31.1
>
Thomas Zimmermann April 27, 2021, 12:10 p.m. UTC | #2
Hi Jani

Am 27.04.21 um 14:04 schrieb Jani Nikula:
> On Tue, 27 Apr 2021, Thomas Zimmermann <tzimmermann@suse.de> wrote:
>> V7 of the patchset fixes some bitrot in the intel driver.
>>
>> 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.
> 
> On the series,
> 
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> 
> How should we merge these?

Thanks for the quick reply.

There is another pdev patch that I just sent out. [1] It has to go into 
the intel tree. After it landed, I want to get this patchset into 
drm-misc-next ASAP. Otherwise, drm-tip would stop building.

This should fix things in the correct order and finally remove pdev for 
current drivers.

Best regards
Thomas

[1] 
https://lore.kernel.org/dri-devel/20210427110747.2065-1-tzimmermann@suse.de/T/#u

> 
> 
> 
>>
>> v7:
>> 	* fix instances of pdev that have benn added under i915/
>> v6:
>> 	* also remove assignment in i915/selftests in later patch (Chris)
>> v5:
>> 	* remove assignment in later patch (Chris)
>> v4:
>> 	* merged several patches
>> 	* moved core changes into separate patch
>> 	* vmwgfx build fix
>> v3:
>> 	* merged several patches
>> 	* 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 (4):
>>    drm/i915/gt: Remove reference to struct drm_device.pdev
>>    drm/i915: Remove reference to struct drm_device.pdev
>>    drm/i915: Don't assign to struct drm_device.pdev
>>    drm: Move struct drm_device.pdev to legacy section
>>
>>   drivers/gpu/drm/i915/gt/intel_region_lmem.c      | 2 +-
>>   drivers/gpu/drm/i915/i915_drv.c                  | 1 -
>>   drivers/gpu/drm/i915/intel_runtime_pm.h          | 2 +-
>>   drivers/gpu/drm/i915/selftests/mock_gem_device.c | 1 -
>>   include/drm/drm_device.h                         | 6 +++---
>>   5 files changed, 5 insertions(+), 7 deletions(-)
>>
>> --
>> 2.31.1
>>
>
Jani Nikula April 27, 2021, 1 p.m. UTC | #3
On Tue, 27 Apr 2021, Thomas Zimmermann <tzimmermann@suse.de> wrote:
> Hi Jani
>
> Am 27.04.21 um 14:04 schrieb Jani Nikula:
>> On Tue, 27 Apr 2021, Thomas Zimmermann <tzimmermann@suse.de> wrote:
>>> V7 of the patchset fixes some bitrot in the intel driver.
>>>
>>> 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.
>> 
>> On the series,
>> 
>> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
>> 
>> How should we merge these?
>
> Thanks for the quick reply.
>
> There is another pdev patch that I just sent out. [1] It has to go into 
> the intel tree. After it landed, I want to get this patchset into 
> drm-misc-next ASAP. Otherwise, drm-tip would stop building.

On merging the series via drm-misc-next,

Acked-by: Jani Nikula <jani.nikula@intel.com>

>
> This should fix things in the correct order and finally remove pdev for 
> current drivers.
>
> Best regards
> Thomas
>
> [1] 
> https://lore.kernel.org/dri-devel/20210427110747.2065-1-tzimmermann@suse.de/T/#u
>
>> 
>> 
>> 
>>>
>>> v7:
>>> 	* fix instances of pdev that have benn added under i915/
>>> v6:
>>> 	* also remove assignment in i915/selftests in later patch (Chris)
>>> v5:
>>> 	* remove assignment in later patch (Chris)
>>> v4:
>>> 	* merged several patches
>>> 	* moved core changes into separate patch
>>> 	* vmwgfx build fix
>>> v3:
>>> 	* merged several patches
>>> 	* 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 (4):
>>>    drm/i915/gt: Remove reference to struct drm_device.pdev
>>>    drm/i915: Remove reference to struct drm_device.pdev
>>>    drm/i915: Don't assign to struct drm_device.pdev
>>>    drm: Move struct drm_device.pdev to legacy section
>>>
>>>   drivers/gpu/drm/i915/gt/intel_region_lmem.c      | 2 +-
>>>   drivers/gpu/drm/i915/i915_drv.c                  | 1 -
>>>   drivers/gpu/drm/i915/intel_runtime_pm.h          | 2 +-
>>>   drivers/gpu/drm/i915/selftests/mock_gem_device.c | 1 -
>>>   include/drm/drm_device.h                         | 6 +++---
>>>   5 files changed, 5 insertions(+), 7 deletions(-)
>>>
>>> --
>>> 2.31.1
>>>
>>