All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Dominik Grzegorzek <dominik.grzegorzek@intel.com>,
	igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 1/2] i915/gem_caching: Remove libdrm dependency
Date: Mon, 06 Jul 2020 18:42:28 +0100	[thread overview]
Message-ID: <159405734884.24180.7353589635990715231@build.alporthouse.com> (raw)
In-Reply-To: <20200706072118.17441-2-dominik.grzegorzek@intel.com>

Quoting Dominik Grzegorzek (2020-07-06 08:21:17)
> Thanks to intel_bb we are able to remove libdrm from gem_caching.
> 
> Signed-off-by: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  tests/i915/gem_caching.c | 176 ++++++++++++++++++++++++---------------
>  1 file changed, 107 insertions(+), 69 deletions(-)
> 
> diff --git a/tests/i915/gem_caching.c b/tests/i915/gem_caching.c
> index 0ffffa05..0f83d0d6 100644
> --- a/tests/i915/gem_caching.c
> +++ b/tests/i915/gem_caching.c
> @@ -39,7 +39,6 @@
>  
>  #include "i915/gem.h"
>  #include "igt.h"
> -#include "intel_bufmgr.h"
>  
>  IGT_TEST_DESCRIPTION("Test snoop consistency when touching partial"
>                      " cachelines.");
> @@ -49,50 +48,83 @@ IGT_TEST_DESCRIPTION("Test snoop consistency when touching partial"
>   *
>   */
>  
> -static drm_intel_bufmgr *bufmgr;
> -struct intel_batchbuffer *batch;
> -
> -drm_intel_bo *scratch_bo;
> -drm_intel_bo *staging_bo;
>  #define BO_SIZE (4*4096)
> -uint32_t devid;
> -int fd;
> +#define PAGE_SIZE 4096
> +
> +typedef struct {
> +       int fd;
> +       uint32_t devid;
> +       struct buf_ops *bops;
> +} data_t;
> +
> +
> +static void *__try_gtt_map_first(data_t *data, struct intel_buf *buf,
> +                                int write_enable)
> +{
> +       uint8_t *ptr;
> +       unsigned int prot = PROT_READ | (write_enable ? PROT_WRITE : 0);
> +
> +       ptr = __gem_mmap__gtt(data->fd, buf->handle, buf->size, prot);
> +       if (!ptr) {
> +               ptr = gem_mmap__device_coherent(data->fd, buf->handle,
> +                                         0, buf->size,  prot);
> +       }
> +       return ptr;
> +}

So I had to think whether or not this was worth keeping [gtt first,
rather than just use device_coherent]. And in the end the peculiarity of
GTT vs caching won out, so I agree better to keep trying gtt if it's
there.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2020-07-06 17:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-06  7:21 [igt-dev] [PATCH i-g-t 0/2] Remove libdrm dependency from gem_[caching/hang] Dominik Grzegorzek
2020-07-06  7:21 ` [igt-dev] [PATCH i-g-t 1/2] i915/gem_caching: Remove libdrm dependency Dominik Grzegorzek
2020-07-06 17:42   ` Chris Wilson [this message]
2020-07-06  7:21 ` [igt-dev] [PATCH i-g-t 2/2] i915/gem_hang: Removal Dominik Grzegorzek
2020-07-06 17:49   ` Chris Wilson
2020-07-06  7:47 ` [igt-dev] ✓ Fi.CI.BAT: success for Remove libdrm dependency from gem_[caching/hang] (rev3) Patchwork
2020-07-06  8:45 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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=159405734884.24180.7353589635990715231@build.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=dominik.grzegorzek@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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.