Re: [PATCH] drm/i915: Refactor dma mask usage to a common helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>-----Original Message-----
>From: Ruhl, Michael J
>Sent: Friday, April 17, 2020 1:21 PM
>To: 'Chris Wilson' <chris@xxxxxxxxxxxxxxxxxx>; intel-gfx@xxxxxxxxxxxxxxxxxxxxx
>Subject: RE:  [PATCH] drm/i915: Refactor dma mask usage to a
>common helper
>
>>-----Original Message-----
>>From: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
>>Sent: Friday, April 17, 2020 12:20 PM
>>To: Ruhl, Michael J <michael.j.ruhl@xxxxxxxxx>; intel-
>>gfx@xxxxxxxxxxxxxxxxxxxxx
>>Subject: Re:  [PATCH] drm/i915: Refactor dma mask usage to a
>>common helper
>>
>>Quoting Ruhl, Michael J (2020-04-17 17:07:24)
>>> >-----Original Message-----
>>> >From: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
>>> >Sent: Friday, April 17, 2020 11:43 AM
>>> >To: Ruhl, Michael J <michael.j.ruhl@xxxxxxxxx>; intel-
>>> >gfx@xxxxxxxxxxxxxxxxxxxxx
>>> >Subject: Re:  [PATCH] drm/i915: Refactor dma mask usage to a
>>> >common helper
>>> >
>>> >Quoting Michael J. Ruhl (2020-04-17 16:22:44)
>>> >> DMA_MASK bit values are different for different generations.
>>> >>
>>> >> This will become more difficult to manage over time with the open
>>> >> coded usage of different versions of the device.
>>> >>
>>> >> Fix by:
>>> >>   adding dma_mask_size to the device info configuration,
>>> >>   updating open code call sequence to the latest interface,
>>> >>   refactoring into a common function for setting the dma_mask
>>> >>
>>> >> Note: GEN(5) and down is also set in intel_gmch_probe().
>>> >
>>> >Assume we pull that code into i915.ko, we will one day.
>>>
>>> The gen5 stuff has the same dma_mask_size that I added to the
>>> i915 config structures.
>>>
>>> I thought about pulling it out of the gen 5 area, but it appears that that
>>> can be built as a separate driver, and if I pulled it out, the ability for it to
>>> be set in that path would be lost.
>>
>>It's not viable standalone anymore. It's over a decade dead by this
>>point, we can drop the old AGP interface and then the sole user is
>>i915.ko. Even if we did not, you can't use the AGP interface at the same
>>time as i915.ko so we can just orphan char/agp, and use our own code.
>
>Ok, so can I do something like this in char/agp/intel-gtt.c:
>
>#if IS_ENABLED(CONFIG_AGP_INTEL)
>	mask = intel_private.driver->dma_mask_size;
>	if (pci_set_dma_mask(intel_private.pcidev, DMA_BIT_MASK(mask)))
>		dev_err(&intel_private.pcidev->dev,
>			"set gfx device dma mask %d-bit failed!\n", mask);
>	else
>		pci_set_consistent_dma_mask(intel_private.pcidev,
>					    DMA_BIT_MASK(mask));
>#endif

Hmmm, will still need to add an "if (bridge)" around it as well.

M

>
>This would fix my flow issue from the previous comments.
>
>Mike
>
>>-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux