[PATCH 1/3] drm/aperture: Add infrastructure for aperture ownership

Thomas Zimmermann tzimmermann at suse.de
Mon Apr 12 10:31:31 UTC 2021


Hi

Am 12.04.21 um 11:36 schrieb Jani Nikula:
> On Mon, 12 Apr 2021, Thomas Zimmermann <tzimmermann at suse.de> wrote:
>> + * DRM drivers should call drm_aperture_remove_conflicting_framebuffers()
>> + * at the top of their probe function. The function removes any generic
>> + * driver that is currently associated with the given framebuffer memory.
>> + * If the framebuffer is located at PCI BAR 0, the rsp code looks as in the
>> + * example given below.
>> + *
>> + * .. code-block:: c
>> + *
>> + *	static int remove_conflicting_framebuffers(struct pci_dev *pdev)
>> + *	{
>> + *		bool primary = false;
>> + *		resource_size_t base, size;
>> + *		int ret;
>> + *
>> + *		base = pci_resource_start(pdev, 0);
>> + *		size = pci_resource_len(pdev, 0);
>> + *	#ifdef CONFIG_X86
>> + *		primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
>> + *	#endif
>> + *
>> + *		return drm_aperture_remove_conflicting_framebuffers(base, size, primary,
>> + *		                                                    "example driver");
>> + *	}
>> + *
>> + *	static int probe(struct pci_dev *pdev)
>> + *	{
>> + *		int ret;
>> + *
>> + *		// Remove any generic drivers...
>> + *		ret = remove_conflicting_framebuffers(pdev);
>> + *		if (ret)
>> + *			return ret;
>> + *
>> + *		// ... and initialize the hardware.
>> + *		...
>> + *
>> + *		drm_dev_register();
>> + *
>> + *		return 0;
>> + *	}
> 
> I'm guessing you can't use tabs for the first indentation level
> here. IIRC kernel-doc removes the leading comment marker and one
> whitespace whether it's space or tab, resulting in rst where the
> code-block contents are only partially indented.
> 
> Please test the documentation build before applying.

I did and I'm pretty sure it looked correct. But I'll double check.

> 
> Otherwise, the series seems like a nice cleanup.
> 
> Acked-by: Jani Nikula <jani.nikula at intel.com>

Thanks.

Best regards
Thomas

> 
> 
> 

-- 
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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20210412/b892eb33/attachment.sig>


More information about the dri-devel mailing list