public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/4] drm/i915: Replace some open-coded i915_map_coherent_type()
Date: Tue, 2 Oct 2018 12:48:39 +0100	[thread overview]
Message-ID: <75d6ba1b-fc79-50b0-c539-e0cff2ec8820@linux.intel.com> (raw)
In-Reply-To: <20181001194447.29910-1-chris@chris-wilson.co.uk>


On 01/10/2018 20:44, Chris Wilson wrote:
> A few callsites where deciding on using WC or WB maps based on
> HAS_LLC(), so replace them with the equivalent helper function
> i915_map_coherent_type().
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   drivers/gpu/drm/i915/intel_ringbuffer.c          | 3 +--
>   drivers/gpu/drm/i915/selftests/intel_hangcheck.c | 4 ++--
>   drivers/gpu/drm/i915/selftests/intel_lrc.c       | 2 +-
>   3 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> index c092d5099ebf..b8a7a014d46d 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> @@ -1023,8 +1023,7 @@ i915_emit_bb_start(struct i915_request *rq,
>   int intel_ring_pin(struct intel_ring *ring)
>   {
>   	struct i915_vma *vma = ring->vma;
> -	enum i915_map_type map =
> -		HAS_LLC(vma->vm->i915) ? I915_MAP_WB : I915_MAP_WC;
> +	enum i915_map_type map = i915_coherent_map_type(vma->vm->i915);
>   	unsigned int flags;
>   	void *addr;
>   	int ret;
> diff --git a/drivers/gpu/drm/i915/selftests/intel_hangcheck.c b/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
> index db378226ac10..51d0e2bed9e1 100644
> --- a/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
> +++ b/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
> @@ -76,7 +76,7 @@ static int hang_init(struct hang *h, struct drm_i915_private *i915)
>   	h->seqno = memset(vaddr, 0xff, PAGE_SIZE);
>   
>   	vaddr = i915_gem_object_pin_map(h->obj,
> -					HAS_LLC(i915) ? I915_MAP_WB : I915_MAP_WC);
> +					i915_coherent_map_type(i915));
>   	if (IS_ERR(vaddr)) {
>   		err = PTR_ERR(vaddr);
>   		goto err_unpin_hws;
> @@ -234,7 +234,7 @@ hang_create_request(struct hang *h, struct intel_engine_cs *engine)
>   			return ERR_CAST(obj);
>   
>   		vaddr = i915_gem_object_pin_map(obj,
> -						HAS_LLC(h->i915) ? I915_MAP_WB : I915_MAP_WC);
> +						i915_coherent_map_type(h->i915));
>   		if (IS_ERR(vaddr)) {
>   			i915_gem_object_put(obj);
>   			return ERR_CAST(vaddr);
> diff --git a/drivers/gpu/drm/i915/selftests/intel_lrc.c b/drivers/gpu/drm/i915/selftests/intel_lrc.c
> index c8b7f03c35bd..9f241d1c72db 100644
> --- a/drivers/gpu/drm/i915/selftests/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/selftests/intel_lrc.c
> @@ -49,7 +49,7 @@ static int spinner_init(struct spinner *spin, struct drm_i915_private *i915)
>   	}
>   	spin->seqno = memset(vaddr, 0xff, PAGE_SIZE);
>   
> -	mode = HAS_LLC(i915) ? I915_MAP_WB : I915_MAP_WC;
> +	mode = i915_coherent_map_type(i915);
>   	vaddr = i915_gem_object_pin_map(spin->obj, mode);
>   	if (IS_ERR(vaddr)) {
>   		err = PTR_ERR(vaddr);
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2018-10-02 11:48 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-01 19:44 [PATCH 1/4] drm/i915: Replace some open-coded i915_map_coherent_type() Chris Wilson
2018-10-01 19:44 ` [PATCH 2/4] drm/i915: Handle incomplete Z_FINISH for compressed error states Chris Wilson
2018-10-02 12:20   ` Tvrtko Ursulin
2018-10-02 12:24     ` Chris Wilson
2018-10-02 13:13       ` Tvrtko Ursulin
2018-10-02 13:22         ` Chris Wilson
2018-10-02 13:46           ` Tvrtko Ursulin
2018-10-02 13:52             ` Chris Wilson
2018-10-02 14:34               ` Tvrtko Ursulin
2018-10-02 12:36   ` [PATCH v2] " Chris Wilson
2018-10-03  8:24   ` [PATCH v3] " Chris Wilson
2018-10-03  9:04     ` Tvrtko Ursulin
2018-10-03 10:47       ` [Intel-gfx] " Chris Wilson
2018-10-01 19:44 ` [PATCH 3/4] drm/i915: Clear the error PTE just once on finish Chris Wilson
2018-10-02 12:27   ` Tvrtko Ursulin
2018-10-01 19:44 ` [PATCH 4/4] drm/i915: Cache the error string Chris Wilson
2018-10-01 21:39 ` ✗ Fi.CI.SPARSE: warning for series starting with [1/4] drm/i915: Replace some open-coded i915_map_coherent_type() Patchwork
2018-10-01 22:02 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-10-02 11:48 ` Tvrtko Ursulin [this message]
2018-10-02 13:31 ` ✗ Fi.CI.SPARSE: warning for series starting with [1/4] drm/i915: Replace some open-coded i915_map_coherent_type() (rev2) Patchwork
2018-10-02 13:49 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-03  2:47 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-10-03  9:56   ` Martin Peres
2018-10-03  9:05 ` ✗ Fi.CI.BAT: failure for series starting with [1/4] drm/i915: Replace some open-coded i915_map_coherent_type() (rev3) 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=75d6ba1b-fc79-50b0-c539-e0cff2ec8820@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox