<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 16, 2019 at 10:15 AM Bas Nieuwenhuizen <<a href="mailto:bas@basnieuwenhuizen.nl">bas@basnieuwenhuizen.nl</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, Jan 16, 2019 at 3:38 PM Marek Olšák <<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>> wrote:<br>
><br>
><br>
><br>
> On Wed, Jan 16, 2019, 7:46 AM Bas Nieuwenhuizen <<a href="mailto:bas@basnieuwenhuizen.nl" target="_blank">bas@basnieuwenhuizen.nl</a> wrote:<br>
>><br>
>> So random questions:<br>
>><br>
>> 1) In this discussion it was mentioned that some Vulkan drivers still<br>
>> use the bo_list interface. I think that implies radv as I think we're<br>
>> still using bo_list. Is there any other API we should be using? (Also,<br>
>> with VK_EXT_descriptor_indexing I suspect we'll be moving more towards<br>
>> a global bo list instead of a cmd buffer one, as we cannot know all<br>
>> the BOs referenced anymore, but not sure what end state here will be).<br>
>><br>
>> 2) The other alternative mentioned was adding the buffers directly<br>
>> into the submit ioctl. Is this the desired end state (though as above<br>
>> I'm not sure how that works for vulkan)? If yes, what is the timeline<br>
>> for this that we need something in the interim?<br>
><br>
><br>
> Radeonsi already uses this.<br>
><br>
>><br>
>> 3) Did we measure any performance benefit?<br>
>><br>
>> In general I'd like to to ack the raw bo list creation function as<br>
>> this interface seems easier to use. The two arrays thing has always<br>
>> been kind of a pain when we want to use e.g. builtin sort functions to<br>
>> make sure we have no duplicate BOs, but have some comments below.<br>
><br>
><br>
> The reason amdgpu was slower than radeon was because of this inefficient bo list interface.<br>
><br>
>><br>
>> On Mon, Jan 7, 2019 at 8:31 PM Marek Olšák <<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>> wrote:<br>
>> ><br>
>> > From: Marek Olšák <<a href="mailto:marek.olsak@amd.com" target="_blank">marek.olsak@amd.com</a>><br>
>> ><br>
>> > ---<br>
>> > amdgpu/amdgpu-symbol-check | 3 ++<br>
>> > amdgpu/amdgpu.h | 56 +++++++++++++++++++++++++++++++++++++-<br>
>> > amdgpu/amdgpu_bo.c | 36 ++++++++++++++++++++++++<br>
>> > amdgpu/amdgpu_cs.c | 25 +++++++++++++++++<br>
>> > 4 files changed, 119 insertions(+), 1 deletion(-)<br>
>> ><br>
>> > diff --git a/amdgpu/amdgpu-symbol-check b/amdgpu/amdgpu-symbol-check<br>
>> > index 6f5e0f95..96a44b40 100755<br>
>> > --- a/amdgpu/amdgpu-symbol-check<br>
>> > +++ b/amdgpu/amdgpu-symbol-check<br>
>> > @@ -12,20 +12,22 @@ _edata<br>
>> > _end<br>
>> > _fini<br>
>> > _init<br>
>> > amdgpu_bo_alloc<br>
>> > amdgpu_bo_cpu_map<br>
>> > amdgpu_bo_cpu_unmap<br>
>> > amdgpu_bo_export<br>
>> > amdgpu_bo_free<br>
>> > amdgpu_bo_import<br>
>> > amdgpu_bo_inc_ref<br>
>> > +amdgpu_bo_list_create_raw<br>
>> > +amdgpu_bo_list_destroy_raw<br>
>> > amdgpu_bo_list_create<br>
>> > amdgpu_bo_list_destroy<br>
>> > amdgpu_bo_list_update<br>
>> > amdgpu_bo_query_info<br>
>> > amdgpu_bo_set_metadata<br>
>> > amdgpu_bo_va_op<br>
>> > amdgpu_bo_va_op_raw<br>
>> > amdgpu_bo_wait_for_idle<br>
>> > amdgpu_create_bo_from_user_mem<br>
>> > amdgpu_cs_chunk_fence_info_to_data<br>
>> > @@ -40,20 +42,21 @@ amdgpu_cs_destroy_semaphore<br>
>> > amdgpu_cs_destroy_syncobj<br>
>> > amdgpu_cs_export_syncobj<br>
>> > amdgpu_cs_fence_to_handle<br>
>> > amdgpu_cs_import_syncobj<br>
>> > amdgpu_cs_query_fence_status<br>
>> > amdgpu_cs_query_reset_state<br>
>> > amdgpu_query_sw_info<br>
>> > amdgpu_cs_signal_semaphore<br>
>> > amdgpu_cs_submit<br>
>> > amdgpu_cs_submit_raw<br>
>> > +amdgpu_cs_submit_raw2<br>
>> > amdgpu_cs_syncobj_export_sync_file<br>
>> > amdgpu_cs_syncobj_import_sync_file<br>
>> > amdgpu_cs_syncobj_reset<br>
>> > amdgpu_cs_syncobj_signal<br>
>> > amdgpu_cs_syncobj_wait<br>
>> > amdgpu_cs_wait_fences<br>
>> > amdgpu_cs_wait_semaphore<br>
>> > amdgpu_device_deinitialize<br>
>> > amdgpu_device_initialize<br>
>> > amdgpu_find_bo_by_cpu_mapping<br>
>> > diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h<br>
>> > index dc51659a..5b800033 100644<br>
>> > --- a/amdgpu/amdgpu.h<br>
>> > +++ b/amdgpu/amdgpu.h<br>
>> > @@ -35,20 +35,21 @@<br>
>> > #define _AMDGPU_H_<br>
>> ><br>
>> > #include <stdint.h><br>
>> > #include <stdbool.h><br>
>> ><br>
>> > #ifdef __cplusplus<br>
>> > extern "C" {<br>
>> > #endif<br>
>> ><br>
>> > struct drm_amdgpu_info_hw_ip;<br>
>> > +struct drm_amdgpu_bo_list_entry;<br>
>> ><br>
>> > /*--------------------------------------------------------------------------*/<br>
>> > /* --------------------------- Defines ------------------------------------ */<br>
>> > /*--------------------------------------------------------------------------*/<br>
>> ><br>
>> > /**<br>
>> > * Define max. number of Command Buffers (IB) which could be sent to the single<br>
>> > * hardware IP to accommodate CE/DE requirements<br>
>> > *<br>
>> > * \sa amdgpu_cs_ib_info<br>
>> > @@ -767,34 +768,65 @@ int amdgpu_bo_cpu_unmap(amdgpu_bo_handle buf_handle);<br>
>> > * and no GPU access is scheduled.<br>
>> > * 1 GPU access is in fly or scheduled<br>
>> > *<br>
>> > * \return 0 - on success<br>
>> > * <0 - Negative POSIX Error code<br>
>> > */<br>
>> > int amdgpu_bo_wait_for_idle(amdgpu_bo_handle buf_handle,<br>
>> > uint64_t timeout_ns,<br>
>> > bool *buffer_busy);<br>
>> ><br>
>> > +/**<br>
>> > + * Creates a BO list handle for command submission.<br>
>> > + *<br>
>> > + * \param dev - \c [in] Device handle.<br>
>> > + * See #amdgpu_device_initialize()<br>
>> > + * \param number_of_buffers - \c [in] Number of BOs in the list<br>
>> > + * \param buffers - \c [in] List of BO handles<br>
>> > + * \param result - \c [out] Created BO list handle<br>
>> > + *<br>
>> > + * \return 0 on success\n<br>
>> > + * <0 - Negative POSIX Error code<br>
>> > + *<br>
>> > + * \sa amdgpu_bo_list_destroy_raw()<br>
>> > +*/<br>
>> > +int amdgpu_bo_list_create_raw(amdgpu_device_handle dev,<br>
>> > + uint32_t number_of_buffers,<br>
>> > + struct drm_amdgpu_bo_list_entry *buffers,<br>
>> > + uint32_t *result);<br>
>><br>
>> So AFAIU drm_amdgpu_bo_list_entry takes a raw bo handle while we<br>
>> never get a raw bo handle from libdrm_amdgpu. How are we supposed to<br>
>> fill it in?<br>
><br>
><br>
> This function returns it.<br>
<br>
This function returns a bo_list handle right? I'm talking about the BO<br>
handles in `buffers`, where do we get them?<br></blockquote><div><br></div><div>Query KMS handles using the export function.<br></div><div><br></div><div>Marek</div></div></div>