From mboxrd@z Thu Jan 1 00:00:00 1970 From: Laura Abbott Subject: Re: [RFC][PATCH 5/5 v2] kselftests: Add dma-heap test Date: Fri, 15 Mar 2019 13:07:29 -0700 Message-ID: <232410de-f20c-cde8-fdbb-48ca8ec1223b@redhat.com> References: <1551819273-640-1-git-send-email-john.stultz@linaro.org> <1551819273-640-6-git-send-email-john.stultz@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: John Stultz , Benjamin Gaignard Cc: lkml , Greg KH , Sumit Semwal , Liam Mark , Brian Starkey , "Andrew F . Davis" , Chenbo Feng , Alistair Strachan , ML dri-devel List-Id: dri-devel@lists.freedesktop.org On 3/6/19 9:01 AM, John Stultz wrote: > On Wed, Mar 6, 2019 at 8:14 AM Benjamin Gaignard > wrote: >> Le mar. 5 mars 2019 à 21:54, John Stultz a écrit : >>> + >>> + printf("Allocating 1 MEG\n"); >>> + ret = dmabuf_heap_alloc(heap_fd, ONE_MEG, 0, &dmabuf_fd); >>> + if (ret) >>> + goto out; >>> + >>> + /* DO SOMETHING WITH THE DMABUF HERE? */ >> >> You can do a call to mmap and write a pattern in the buffer. > > Yea. I can also do some invalid allocations to make sure things fail properly. > > But I was talking a bit w/ Sumit about the lack of any general dmabuf > tests, and am curious if we need to have a importer device driver that > can validate its a real dmabuf and exercise more of the dmabuf ops. > > thanks > -john > There's the vgem driver in drm. I did some work to clean that up so it could take an import af33a9190d02 ("drm/vgem: Enable dmabuf import interfaces") . I mostly used it for private tests and never ended up upstreaming any of the tests. Thanks, Laura