public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Keith Packard <keithp@keithp.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 02/15] drm/i915: Accurately track flushed domains
Date: Wed, 23 Mar 2011 06:07:52 +0900	[thread overview]
Message-ID: <yunoc52hniv.fsf@aiko.keithp.com> (raw)
In-Reply-To: <1300801920-23130-3-git-send-email-chris@chris-wilson.co.uk>


[-- Attachment #1.1: Type: text/plain, Size: 2019 bytes --]


I'd love to see the API changes done in separate patches so they can be
reviewed without being mixed in with the actual fixes. This patch
conflates the changing of the sequence number management, ring
synchronization, elimination of the file argument to i915_add_request
with the changes in flush domains.

Also, a commit message which describes in detail what is changing and
why would really help verify that the patch does what it is supposed
to.

>  static inline u32
>  i915_gem_next_request_seqno(struct intel_ring_buffer *ring)
>  {
> -	drm_i915_private_t *dev_priv = ring->dev->dev_private;
> -	return ring->outstanding_lazy_request = dev_priv->next_seqno;
> +	if (ring->outstanding_lazy_request == 0)
> +		ring->outstanding_lazy_request = __i915_gem_get_seqno(ring->dev);
> +	return ring->outstanding_lazy_request;
>  }

Why did the code not allocate a seqno for this before? Why is it
necessary now?

> +	if (i915_ring_outstanding_dispatch(ring)) {
> +		struct drm_i915_gem_request *request;
> +
> +		request = kzalloc(sizeof(*request), GFP_KERNEL);
> +		if (request && i915_add_request(ring, request))
> +			kfree(request);
> +	}
> +

Why is it OK to not add this request when out of memory?

> +		if (!list_empty(&ring->gpu_write_list))
>  			ret = i915_gem_flush_ring(ring,
>  						  0, I915_GEM_GPU_DOMAINS);
> -			request = kzalloc(sizeof(*request), GFP_KERNEL);
> -			if (ret || request == NULL ||
> -			    i915_add_request(ring, NULL, request))
> -			    kfree(request);
> -		}
> -
> -		idle &= list_empty(&ring->request_list);
> +		(void)ret;

If you're going to ignore a __must_check return value, you might at
least justify it in a comment.

>  int
> -i915_gem_flush_ring(struct intel_ring_buffer *ring,
> -		    uint32_t invalidate_domains,
> -		    uint32_t flush_domains)
> +i915_gem_flush_ring(struct intel_ring_buffer *ring, u32 invalidate,
> u32 flush)

Seems like gratuitous variable renaming here.

-- 
keith.packard@intel.com

[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

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

  reply	other threads:[~2011-03-22 21:08 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-22 13:51 next tidbits - use LLC on SNB Chris Wilson
2011-03-22 13:51 ` [PATCH 01/15] drm/i915: Enable use of GPU semaphores to sync page-flips " Chris Wilson
2011-03-22 20:44   ` Keith Packard
2011-03-22 13:51 ` [PATCH 02/15] drm/i915: Accurately track flushed domains Chris Wilson
2011-03-22 21:07   ` Keith Packard [this message]
2011-03-22 13:51 ` [PATCH 03/15] drm/i915: Track last read/write seqno independently Chris Wilson
2011-03-23 17:16   ` Eric Anholt
2011-03-22 13:51 ` [PATCH 04/15] drm/i915: Rename agp_type to cache_level Chris Wilson
2011-03-22 13:51 ` [PATCH 05/15] drm/i915: Mark the cursor and the overlay as being part of the display planes Chris Wilson
2011-03-22 13:51 ` [PATCH 06/15] drm/i915: Add an interface to dynamically change the cache level Chris Wilson
2011-03-22 13:51 ` [PATCH 07/15] drm/i915: Do not clflush snooped objects Chris Wilson
2011-03-22 13:51 ` [PATCH 08/15] drm/i915: Use the uncached domain for the display planes Chris Wilson
2011-03-22 13:51 ` [PATCH 09/15] drm/i915: Refactor pwrite/pread to use single copy of get_user_pages Chris Wilson
2011-03-22 13:51 ` [PATCH 10/15] drm/i915: Use kmap_atomic for shmem pread Chris Wilson
2011-03-22 13:51 ` [PATCH 11/15] drm/i915: Use the CPU domain for snooped pwrites Chris Wilson
2011-03-22 13:51 ` [PATCH 12/15] drm/i915: s/addr & ~PAGE_MASK/offset_in_page(addr)/ Chris Wilson
2011-03-22 13:51 ` [PATCH 13/15] drm/i915: Implement GTT variants of pread Chris Wilson
2011-03-23 17:23   ` Eric Anholt
2011-03-23 17:30     ` Chris Wilson
2011-03-24 17:44       ` Keith Packard
2011-03-24 19:47         ` Chris Wilson
2011-03-22 13:51 ` [PATCH 14/15] drm/i915: Cleanup flush|invalidate domain tracking for set_to_gpu Chris Wilson
2011-03-22 13:52 ` [PATCH 15/15] drm/i915: Use the LLC mode on gen6 for everything but display Chris Wilson

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=yunoc52hniv.fsf@aiko.keithp.com \
    --to=keithp@keithp.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