All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
To: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>,
	igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 2/3] tests/prime_mmap: Iterate over dma-buf supported memory regions
Date: Wed, 2 Mar 2022 13:54:16 +0200	[thread overview]
Message-ID: <e0ee2f41-fc0d-67dc-832e-5c09e8fab32c@intel.com> (raw)
In-Reply-To: <261ba339-2e7d-f9ff-6f5f-ccca457ef1b8@intel.com>

This is the result of igt@prime_mmap tests
  - mmap fix for lmem kernel patch was applied: 
https://patchwork.freedesktop.org/series/100737/

  - Tested HW: DG1,

IGT-Version: 1.26-g9458a2f1 (x86_64) (Linux: 5.17.0-rc5-drm-tip-test+ 
x86_64)
Starting subtest: test_correct
Starting dynamic subtest: test_correct-smem
Dynamic subtest test_correct-smem: SUCCESS (0.036s)
Starting dynamic subtest: test_correct-lmem0
Dynamic subtest test_correct-lmem0: SUCCESS (0.146s)
Subtest test_correct: SUCCESS (0.182s)
Starting subtest: test_map_unmap
Starting dynamic subtest: test_map_unmap-smem
Dynamic subtest test_map_unmap-smem: SUCCESS (0.036s)
Starting dynamic subtest: test_map_unmap-lmem0
Dynamic subtest test_map_unmap-lmem0: SUCCESS (0.142s)
Subtest test_map_unmap: SUCCESS (0.178s)
Starting subtest: test_reprime
Starting dynamic subtest: test_reprime-smem
Dynamic subtest test_reprime-smem: SUCCESS (0.036s)
Starting dynamic subtest: test_reprime-lmem0
Dynamic subtest test_reprime-lmem0: SUCCESS (0.143s)
Subtest test_reprime: SUCCESS (0.179s)
Starting subtest: test_forked
Starting dynamic subtest: test_forked-smem
Dynamic subtest test_forked-smem: SUCCESS (0.048s)
Starting dynamic subtest: test_forked-lmem0
Dynamic subtest test_forked-lmem0: SUCCESS (0.154s)
Subtest test_forked: SUCCESS (0.202s)
Starting subtest: test_correct_cpu_write
Starting dynamic subtest: test_correct_cpu_write-smem
Dynamic subtest test_correct_cpu_write-smem: SUCCESS (0.000s)
Starting dynamic subtest: test_correct_cpu_write-lmem0
Dynamic subtest test_correct_cpu_write-lmem0: SUCCESS (0.000s)
Subtest test_correct_cpu_write: SUCCESS (0.001s)
Starting subtest: test_forked_cpu_write
Starting dynamic subtest: test_forked_cpu_write-smem
Dynamic subtest test_forked_cpu_write-smem: SUCCESS (0.012s)
Starting dynamic subtest: test_forked_cpu_write-lmem0
Dynamic subtest test_forked_cpu_write-lmem0: SUCCESS (0.012s)
Subtest test_forked_cpu_write: SUCCESS (0.024s)
Starting subtest: test_refcounting
Starting dynamic subtest: test_refcounting-smem
Dynamic subtest test_refcounting-smem: SUCCESS (0.037s)
Starting dynamic subtest: test_refcounting-lmem0
Dynamic subtest test_refcounting-lmem0: SUCCESS (0.145s)
Subtest test_refcounting: SUCCESS (0.181s)
Starting subtest: test_dup
Starting dynamic subtest: test_dup-smem
Dynamic subtest test_dup-smem: SUCCESS (0.036s)
Starting dynamic subtest: test_dup-lmem0
Dynamic subtest test_dup-lmem0: SUCCESS (0.142s)
Subtest test_dup: SUCCESS (0.179s)
Starting subtest: test_userptr
Starting dynamic subtest: test_userptr-smem
Dynamic subtest test_userptr-smem: SUCCESS (0.000s)
Subtest test_userptr: SUCCESS (0.000s)
Starting subtest: test_errors
Starting dynamic subtest: test_errors-smem
Dynamic subtest test_errors-smem: SUCCESS (0.110s)
Starting dynamic subtest: test_errors-lmem0
Dynamic subtest test_errors-lmem0: SUCCESS (0.437s)
Subtest test_errors: SUCCESS (0.547s)
Starting subtest: test_invalid_sync_flags
Starting dynamic subtest: test_invalid_sync_flags-smem
Dynamic subtest test_invalid_sync_flags-smem: SUCCESS (0.000s)
Starting dynamic subtest: test_invalid_sync_flags-lmem0
Dynamic subtest test_invalid_sync_flags-lmem0: SUCCESS (0.000s)
Subtest test_invalid_sync_flags: SUCCESS (0.000s)
Starting subtest: test_aperture_limit
Starting dynamic subtest: test_aperture_limit-smem
Dynamic subtest test_aperture_limit-smem: SUCCESS (7.086s)
Subtest test_aperture_limit: SUCCESS (7.086s)


On 3/2/22 1:49 PM, Gwan-gyeong Mun wrote:
> Reviewed-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> Tested-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> 
> If the https://patchwork.freedesktop.org/series/100737/ patch (currently 
> under review) is applied to the i915, you can see that the 
> igt@prime_mmap test works normally in dg1.
> 
> On 3/1/22 9:58 AM, Zbigniew Kempczyński wrote:
>> To avoid code duplication (prime_mmap_coherency uses similar code)
>> use helper function which returns dma-buf set of supported regions.
>>
>> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
>> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
>> ---
>>   tests/prime_mmap.c | 34 ++++++----------------------------
>>   1 file changed, 6 insertions(+), 28 deletions(-)
>>
>> diff --git a/tests/prime_mmap.c b/tests/prime_mmap.c
>> index e0cb9a25b..d53185ff1 100644
>> --- a/tests/prime_mmap.c
>> +++ b/tests/prime_mmap.c
>> @@ -483,31 +483,6 @@ test_aperture_limit(uint32_t region, int size)
>>       gem_close(fd, handle2);
>>   }
>> -static int
>> -check_for_dma_buf_mmap(struct igt_collection *set)
>> -{
>> -    struct igt_collection *region;
>> -    uint32_t reg;
>> -    int dma_buf_fd;
>> -    char *ptr;
>> -    uint32_t handle;
>> -    int ret = 1;
>> -
>> -    for_each_combination(region, 1, set) {
>> -        reg = igt_collection_get_value(region, 0);
>> -        handle = gem_create_in_memory_regions(fd, BO_SIZE, reg);
>> -
>> -        dma_buf_fd = prime_handle_to_fd(fd, handle);
>> -        ptr = mmap(NULL, BO_SIZE, PROT_READ, MAP_SHARED, dma_buf_fd, 0);
>> -        if (ptr != MAP_FAILED)
>> -            ret = 0;
>> -        munmap(ptr, BO_SIZE);
>> -        gem_close(fd, handle);
>> -        close(dma_buf_fd);
>> -    }
>> -    return ret;
>> -}
>> -
>>   #define SKIP_LMEM (1 << 0)
>>   #define SKIP_USERPTR (1 << 1)
>> @@ -527,7 +502,7 @@ static bool check_skip(uint32_t skip, uint32_t 
>> region)
>>   igt_main
>>   {
>> -    struct igt_collection *set, *regions;
>> +    struct igt_collection *set, *regions, *dma_buf_set;
>>       struct drm_i915_query_memory_regions *query_info;
>>       struct {
>>           const char *name;
>> @@ -560,13 +535,15 @@ igt_main
>>           set = get_memory_region_set(query_info, I915_SYSTEM_MEMORY,
>>                           I915_DEVICE_MEMORY);
>> -        igt_assert(check_for_dma_buf_mmap(set) == 0);
>> +
>> +        dma_buf_set = get_dma_buf_mmap_supported_set(fd, set);
>> +        igt_require_f(dma_buf_set, "No dma-buf region supported\n");
>>           errno = 0;
>>       }
>>       for (i = 0; i < ARRAY_SIZE(tests); i++)
>>           igt_subtest_with_dynamic(tests[i].name) {
>> -            for_each_combination(regions, 1, set) {
>> +            for_each_combination(regions, 1, dma_buf_set) {
>>                   region = igt_collection_get_value(regions, 0);
>>                   size = gem_get_batch_size(fd, 
>> MEMORY_TYPE_FROM_REGION(region));
>>                   size = max(size, BO_SIZE);
>> @@ -582,6 +559,7 @@ igt_main
>>       igt_fixture {
>>           free(query_info);
>>           igt_collection_destroy(set);
>> +        igt_collection_destroy(dma_buf_set);
>>           close(fd);
>>       }
>>   }
>>

  reply	other threads:[~2022-03-02 11:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-01  7:58 [igt-dev] [PATCH i-g-t 0/3] Use supported dma-buf regions in prime_mmap* Zbigniew Kempczyński
2022-03-01  7:58 ` [igt-dev] [PATCH i-g-t 1/3] lib/intel_memory_regions: Add helper which creates supported dma-buf set Zbigniew Kempczyński
2022-03-02 11:48   ` Gwan-gyeong Mun
2022-03-01  7:58 ` [igt-dev] [PATCH i-g-t 2/3] tests/prime_mmap: Iterate over dma-buf supported memory regions Zbigniew Kempczyński
2022-03-01 12:38   ` Kamil Konieczny
2022-03-02 11:49   ` Gwan-gyeong Mun
2022-03-02 11:54     ` Gwan-gyeong Mun [this message]
2022-03-01  7:58 ` [igt-dev] [PATCH i-g-t 3/3] tests/prime_mmap_coherency.c: Use intel_bb and intel_buf to remove libdrm dependency Zbigniew Kempczyński
2022-03-01  8:44 ` [igt-dev] ✓ Fi.CI.BAT: success for Use supported dma-buf regions in prime_mmap* (rev2) Patchwork
2022-03-01 15:35 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2022-03-02  8:06 [igt-dev] [PATCH i-g-t 0/3] Use supported dma-buf regions in prime_mmap* Zbigniew Kempczyński
2022-03-02  8:06 ` [igt-dev] [PATCH i-g-t 2/3] tests/prime_mmap: Iterate over dma-buf supported memory regions Zbigniew Kempczyński
2022-03-02  9:42   ` Kamil Konieczny
2022-03-02 12:24   ` Gwan-gyeong Mun
2022-02-28 13:03 [igt-dev] [PATCH i-g-t 0/3] Use supported dma-buf regions in prime_mmap* Zbigniew Kempczyński
2022-02-28 13:03 ` [igt-dev] [PATCH i-g-t 2/3] tests/prime_mmap: Iterate over dma-buf supported memory regions Zbigniew Kempczyński
2022-02-28 21:39   ` Kamil Konieczny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e0ee2f41-fc0d-67dc-832e-5c09e8fab32c@intel.com \
    --to=gwan-gyeong.mun@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=zbigniew.kempczynski@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.