Re: [PATCH 1/4] drivers: hv: dxgkrnl: core code
From: Pavel Machek
Date: Fri Aug 21 2020 - 09:55:25 EST
On Fri 2020-08-14 08:38:53, Sasha Levin wrote:
> Add support for a Hyper-V based vGPU implementation that exposes the
> DirectX API to Linux userspace.
NAK.
Kernel APIs should be documented. ... in tree and with suitable license.
> +int dxgadapter_init(struct dxgadapter *adapter, struct hv_device *hdev)
> +{
> + int ret = 0;
> + char s[80];
> +
> + UNUSED(s);
What is going on here?
> +{
> + struct dxgprocess_adapter *adapter_info = dxgmem_alloc(process,
> + DXGMEM_PROCESS_ADAPTER,
> + sizeof
> + (*adapter_info));
We normally use kernel functions in kernel code.
> + dxgmutex_unlock(&device->adapter_info->device_list_mutex);
And you should not have private locking primitives, either.
> +bool dxghwqueue_acquire_reference(struct dxghwqueue *hwqueue)
> +{
> + return refcount_inc_not_zero(&hwqueue->refcount);
> +}
Midlayers are evil.
Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html