All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Matthew Auld <matthew.auld@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/6] drm/i915: support creating LMEM objects
Date: Fri, 18 Oct 2019 22:48:59 +0100	[thread overview]
Message-ID: <157143533944.10963.9211804474202386762@skylake-alporthouse-com> (raw)
In-Reply-To: <20191018165558.18518-1-matthew.auld@intel.com>

Quoting Matthew Auld (2019-10-18 17:55:53)
> diff --git a/drivers/gpu/drm/i915/intel_region_lmem.c b/drivers/gpu/drm/i915/intel_region_lmem.c
> new file mode 100644
> index 000000000000..7a3f96e1f766
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/intel_region_lmem.c
> @@ -0,0 +1,43 @@
> +// SPDX-License-Identifier: MIT
> +/*
> + * Copyright © 2019 Intel Corporation
> + */
> +
> +#include "i915_drv.h"
> +#include "intel_memory_region.h"
> +#include "gem/i915_gem_lmem.h"
> +#include "gem/i915_gem_region.h"
> +#include "intel_region_lmem.h"
> +
> +static struct drm_i915_gem_object *
> +lmem_create_object(struct intel_memory_region *mem,
> +                  resource_size_t size,
> +                  unsigned int flags)
> +{
> +       struct drm_i915_private *i915 = mem->i915;
> +       struct drm_i915_gem_object *obj;
> +
> +       if (size > BIT(mem->mm.max_order) * mem->mm.chunk_size)
> +               return ERR_PTR(-E2BIG);
> +
> +       obj = i915_gem_object_alloc();
> +       if (!obj)
> +               return ERR_PTR(-ENOMEM);
> +
> +       drm_gem_private_object_init(&i915->drm, &obj->base, size);
> +       i915_gem_object_init(obj, &i915_gem_lmem_obj_ops);

Ah no. Under the current partitioning, you are leaking the GEM object
class out of its hierarchy.

intel_region_*.c provide the abstractions to work with the HW, with
gem/i915_gem_lmem.c wrapping that into a GEM object.

What's the driving force to put the _GEM_ object interface here?
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      parent reply	other threads:[~2019-10-18 21:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-18 16:55 [PATCH 1/6] drm/i915: support creating LMEM objects Matthew Auld
2019-10-18 16:55 ` [PATCH 2/6] drm/i915: setup io-mapping for LMEM Matthew Auld
2019-10-18 22:50   ` Chris Wilson
2019-10-18 16:55 ` [PATCH 3/6] drm/i915/lmem: support kernel mapping Matthew Auld
2019-10-18 22:48   ` Chris Wilson
2019-10-18 16:55 ` [PATCH 4/6] drm/i915/selftests: add write-dword test for LMEM Matthew Auld
2019-10-18 22:46   ` Chris Wilson
2019-10-18 16:55 ` [PATCH 5/6] drm/i915/selftests: extend coverage to include LMEM huge-pages Matthew Auld
2019-10-18 22:44   ` Chris Wilson
2019-10-18 16:55 ` [PATCH 6/6] drm/i915/selftests: prefer random sizes for the huge-GTT-page smoke tests Matthew Auld
2019-10-18 22:43   ` Chris Wilson
2019-10-18 17:54 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/6] drm/i915: support creating LMEM objects Patchwork
2019-10-18 17:57 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-10-18 18:27 ` ✓ Fi.CI.BAT: success " Patchwork
2019-10-18 20:43 ` ✓ Fi.CI.IGT: " Patchwork
2019-10-18 21:48 ` Chris Wilson [this message]

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=157143533944.10963.9211804474202386762@skylake-alporthouse-com \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.auld@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.