[PATCH v2 1/2] dxgi: Implement dxgi_output_ReleaseOwnership.

Zhiyi Zhang zzhang at codeweavers.com
Thu Oct 24 10:45:23 CDT 2019



On 10/24/19 11:24 PM, Henri Verbeet wrote:
> On Thu, 24 Oct 2019 at 16:17, Zhiyi Zhang <zzhang at codeweavers.com> wrote:
>> -static void dxgi_output_init(struct dxgi_output *output, struct dxgi_adapter *adapter)
>> +static HRESULT dxgi_output_init(struct dxgi_output *output, struct dxgi_adapter *adapter)
>>  {
>> +    struct wined3d_output_desc wined3d_desc;
>> +
>>      output->IDXGIOutput4_iface.lpVtbl = &dxgi_output_vtbl;
>>      output->refcount = 1;
>>      wined3d_private_store_init(&output->private_store);
>>      output->adapter = adapter;
>>      IWineDXGIAdapter_AddRef(&output->adapter->IWineDXGIAdapter_iface);
>> +
>> +    wined3d_mutex_lock();
>> +    wined3d_get_output_desc(output->adapter->factory->wined3d, output->adapter->ordinal, &wined3d_desc);
>> +    wined3d_mutex_unlock();
>> +
>> +    return wined3d_output_create(wined3d_desc.device_name, &output->wined3d_output);
>>  }
> It doesn't seem right for the wined3d output to be created by the dxgi
> output, it seems like it should be owned by the wined3d_adapter
> instead. I.e., I think ideally we'd have something like
> "wined3d_output = wined3d_adapter_get_output(wined3d_adapter,
> output_idx);", but until adapters and outputs are split on the wined3d
> level, that would probably have to be something like "wined3d_output =
> wined3d_get_adapter_output(wined3d, adapter_idx);" instead.
>
> If you're up for it (and since I know you've been doing work in this
> area), perhaps it makes sense to convert things like
> "wined3d_get_adapter_display_mode(wined3d, adapter_idx, ...)" to
> "wined3d_adapter_get_display_mode(wined3d_adapter, ...)" as a first
> step.
I have been kind of avoiding the split to minimize code changes.
Now that it seems it's inevitable, I will work on the split.
There are probably some complications of unifying d3d9 devices
and dxgi devices to use the same wined3d devices, but I think I
will get there.

We also need to define what 'adapter' actually means in wined3d.
I think we should define it as the physical GPU. So instead of
'wined3d_adapter_get_display_mode' we should have
'wined3d_output_get_display_mode'



More information about the wine-devel mailing list