Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: paulo.r.zanoni@intel.com, thomas.hellstrom@intel.com,
	matthew.auld@intel.com, daniel.vetter@intel.com,
	christian.koenig@amd.com
Subject: Re: [Intel-gfx] [RFC v4 08/14] drm/i915/vm_bind: Abstract out common execbuf functions
Date: Thu, 22 Sep 2022 12:54:09 +0300	[thread overview]
Message-ID: <877d1v7n0e.fsf@intel.com> (raw)
In-Reply-To: <20220921070945.27764-9-niranjana.vishwanathapura@intel.com>

On Wed, 21 Sep 2022, Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com> wrote:
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer_common.h b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer_common.h
> new file mode 100644
> index 000000000000..725febfd6a53
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer_common.h
> @@ -0,0 +1,47 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright © 2022 Intel Corporation
> + */
> +
> +#ifndef __I915_GEM_EXECBUFFER_COMMON_H
> +#define __I915_GEM_EXECBUFFER_COMMON_H
> +
> +#include <drm/drm_syncobj.h>
> +
> +#include "gt/intel_context.h"

You don't need these includes. Most of it can be handled using forward
declarations. You'll need <linux/types.h>

> +
> +struct eb_fence {
> +	struct drm_syncobj *syncobj;
> +	struct dma_fence *dma_fence;
> +	u64 value;
> +	struct dma_fence_chain *chain_fence;
> +};
> +
> +int __eb_pin_engine(struct intel_context *ce, struct i915_gem_ww_ctx *ww,
> +		    bool throttle, bool nonblock);
> +void __eb_unpin_engine(struct intel_context *ce);
> +int __eb_select_engine(struct intel_context *ce);
> +void __eb_put_engine(struct intel_context *context, struct intel_gt *gt);
> +
> +struct intel_context *
> +eb_find_context(struct intel_context *context, unsigned int context_number);
> +
> +int add_timeline_fence(struct drm_file *file, u32 handle, u64 point,
> +		       struct eb_fence *f, bool wait, bool signal);
> +void put_fence_array(struct eb_fence *fences, u64 num_fences);
> +int await_fence_array(struct eb_fence *fences, u64 num_fences,
> +		      struct i915_request *rq);
> +void signal_fence_array(struct eb_fence *fences, u64 num_fences,
> +			struct dma_fence * const fence);
> +
> +int eb_requests_add(struct i915_request **requests, unsigned int num_batches,
> +		    struct intel_context *context, struct i915_sched_attr sched,

struct i915_sched_attr is passed by value, so you either need to turn
that into a pointer, or you need the definition. The definition is just
a wrapper around an int. (For strict type safety or for future proofing
or what, I don't know.) And this all brings me to my pet peeve about
gem/gt headers.

To get that definition of a struct wrapper around an int, you need to
include i915_scheduler_types.h, which recursively includes a total of 16
headers. Touch any of those files, and you get a rebuild butterfly
effect.

28% of i915 header files, when modified, cause the rebuild of 83% of the
driver. Please let's not make it worse.


BR,
Jani.

> +		    int err);
> +void eb_requests_get(struct i915_request **requests, unsigned int num_batches);
> +void eb_requests_put(struct i915_request **requests, unsigned int num_batches);
> +
> +struct dma_fence *__eb_composite_fence_create(struct i915_request **requests,
> +					      unsigned int num_batches,
> +					      struct intel_context *context);
> +
> +#endif /* __I915_GEM_EXECBUFFER_COMMON_H */

-- 
Jani Nikula, Intel Open Source Graphics Center

  parent reply	other threads:[~2022-09-22  9:54 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-21  7:09 [Intel-gfx] [RFC v4 00/14] drm/i915/vm_bind: Add VM_BIND functionality Niranjana Vishwanathapura
2022-09-21  7:09 ` [Intel-gfx] [RFC v4 01/14] drm/i915/vm_bind: Expose vm lookup function Niranjana Vishwanathapura
2022-09-21  7:09 ` [Intel-gfx] [RFC v4 02/14] drm/i915/vm_bind: Add __i915_sw_fence_await_reservation() Niranjana Vishwanathapura
2022-09-21  9:06   ` Tvrtko Ursulin
2022-09-21 17:47     ` Niranjana Vishwanathapura
2022-09-22  9:26   ` Jani Nikula
2022-09-21  7:09 ` [Intel-gfx] [RFC v4 03/14] drm/i915/vm_bind: Expose i915_gem_object_max_page_size() Niranjana Vishwanathapura
2022-09-21  9:13   ` Tvrtko Ursulin
2022-09-21 18:00     ` Niranjana Vishwanathapura
2022-09-22  8:09       ` Tvrtko Ursulin
2022-09-22 16:18         ` Matthew Auld
2022-09-22 16:46           ` Niranjana Vishwanathapura
2022-09-23  7:45           ` Tvrtko Ursulin
2022-09-21  7:09 ` [Intel-gfx] [RFC v4 04/14] drm/i915/vm_bind: Implement bind and unbind of object Niranjana Vishwanathapura
2022-09-22  9:29   ` Jani Nikula
2022-09-21  7:09 ` [Intel-gfx] [RFC v4 05/14] drm/i915/vm_bind: Support for VM private BOs Niranjana Vishwanathapura
2022-09-21  7:09 ` [Intel-gfx] [RFC v4 06/14] drm/i915/vm_bind: Handle persistent vmas Niranjana Vishwanathapura
2022-09-27  2:36   ` Zeng, Oak
2022-09-27  5:45     ` Niranjana Vishwanathapura
2022-09-21  7:09 ` [Intel-gfx] [RFC v4 07/14] drm/i915/vm_bind: Add out fence support Niranjana Vishwanathapura
2022-09-22  9:31   ` Jani Nikula
2022-09-21  7:09 ` [Intel-gfx] [RFC v4 08/14] drm/i915/vm_bind: Abstract out common execbuf functions Niranjana Vishwanathapura
2022-09-21 10:18   ` Tvrtko Ursulin
2022-09-21 18:17     ` Niranjana Vishwanathapura
2022-09-22  9:05       ` Tvrtko Ursulin
2022-09-22 14:12         ` Niranjana Vishwanathapura
2022-09-22  9:54   ` Jani Nikula [this message]
2022-09-24  4:22     ` Niranjana Vishwanathapura
2022-09-21  7:09 ` [Intel-gfx] [RFC v4 09/14] drm/i915/vm_bind: Implement I915_GEM_EXECBUFFER3 ioctl Niranjana Vishwanathapura
2022-09-21  7:09 ` [Intel-gfx] [RFC v4 10/14] drm/i915/vm_bind: Update i915_vma_verify_bind_complete() Niranjana Vishwanathapura
2022-09-21  7:09 ` [Intel-gfx] [RFC v4 11/14] drm/i915/vm_bind: Handle persistent vmas in execbuf3 Niranjana Vishwanathapura
2022-09-21  7:09 ` [Intel-gfx] [RFC v4 12/14] drm/i915/vm_bind: userptr dma-resv changes Niranjana Vishwanathapura
2022-09-21  7:09 ` [Intel-gfx] [RFC v4 13/14] drm/i915/vm_bind: Skip vma_lookup for persistent vmas Niranjana Vishwanathapura
2022-09-23  8:40   ` Tvrtko Ursulin
2022-09-24  4:30     ` Niranjana Vishwanathapura
2022-09-26 16:26       ` Tvrtko Ursulin
2022-09-26 17:09         ` Niranjana Vishwanathapura
2022-09-27  9:28           ` Tvrtko Ursulin
2022-09-27 15:37             ` Niranjana Vishwanathapura
2022-09-21  7:09 ` [Intel-gfx] [RFC v4 14/14] drm/i915/vm_bind: Add uapi for user to enable vm_bind_mode Niranjana Vishwanathapura
2022-09-21  8:33 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/vm_bind: Add VM_BIND functionality (rev3) Patchwork
2022-09-21  8:55 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " 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=877d1v7n0e.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    --cc=niranjana.vishwanathapura@intel.com \
    --cc=paulo.r.zanoni@intel.com \
    --cc=thomas.hellstrom@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox