public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Dave Airlie <airlied@linux.ie>, DRI <dri-devel@lists.freedesktop.org>
Cc: "Linux Next Mailing List" <linux-next@vger.kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Thomas Hellstrom" <thellstrom@vmware.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Alex Deucher" <alexander.deucher@amd.com>
Subject: linux-next: manual merge of the drm tree with the drm-fixes tree
Date: Fri, 14 Dec 2018 12:51:43 +1100	[thread overview]
Message-ID: <20181214125143.3ecb367b@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 4099 bytes --]

Hi all,

Today's linux-next merge of the drm tree got a conflict in:

  drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c

between commit:

  fd567467753f ("drm/vmwgfx: Protect from excessive execbuf kernel memory allocations v3")

from the drm-fixes tree and commit:

  a64f784bb14a ("drm/ttm: initialize globals during device init (v2)")

from the drm tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c
index f88247046721,154eb09aa91e..000000000000
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c
@@@ -42,93 -42,3 +42,39 @@@ int vmw_mmap(struct file *filp, struct 
  	dev_priv = vmw_priv(file_priv->minor->dev);
  	return ttm_bo_mmap(filp, vma, &dev_priv->bdev);
  }
 +
- static int vmw_ttm_mem_global_init(struct drm_global_reference *ref)
- {
- 	DRM_INFO("global init.\n");
- 	return ttm_mem_global_init(ref->object);
- }
- 
- static void vmw_ttm_mem_global_release(struct drm_global_reference *ref)
- {
- 	ttm_mem_global_release(ref->object);
- }
- 
- int vmw_ttm_global_init(struct vmw_private *dev_priv)
- {
- 	struct drm_global_reference *global_ref;
- 	int ret;
- 
- 	global_ref = &dev_priv->mem_global_ref;
- 	global_ref->global_type = DRM_GLOBAL_TTM_MEM;
- 	global_ref->size = sizeof(struct ttm_mem_global);
- 	global_ref->init = &vmw_ttm_mem_global_init;
- 	global_ref->release = &vmw_ttm_mem_global_release;
- 
- 	ret = drm_global_item_ref(global_ref);
- 	if (unlikely(ret != 0)) {
- 		DRM_ERROR("Failed setting up TTM memory accounting.\n");
- 		return ret;
- 	}
- 
- 	dev_priv->bo_global_ref.mem_glob =
- 		dev_priv->mem_global_ref.object;
- 	global_ref = &dev_priv->bo_global_ref.ref;
- 	global_ref->global_type = DRM_GLOBAL_TTM_BO;
- 	global_ref->size = sizeof(struct ttm_bo_global);
- 	global_ref->init = &ttm_bo_global_init;
- 	global_ref->release = &ttm_bo_global_release;
- 	ret = drm_global_item_ref(global_ref);
- 
- 	if (unlikely(ret != 0)) {
- 		DRM_ERROR("Failed setting up TTM buffer objects.\n");
- 		goto out_no_bo;
- 	}
- 
- 	return 0;
- out_no_bo:
- 	drm_global_item_unref(&dev_priv->mem_global_ref);
- 	return ret;
- }
- 
- void vmw_ttm_global_release(struct vmw_private *dev_priv)
- {
- 	drm_global_item_unref(&dev_priv->bo_global_ref.ref);
- 	drm_global_item_unref(&dev_priv->mem_global_ref);
- }
- 
 +/* struct vmw_validation_mem callback */
 +static int vmw_vmt_reserve(struct vmw_validation_mem *m, size_t size)
 +{
 +	static struct ttm_operation_ctx ctx = {.interruptible = false,
 +					       .no_wait_gpu = false};
 +	struct vmw_private *dev_priv = container_of(m, struct vmw_private, vvm);
 +
 +	return ttm_mem_global_alloc(vmw_mem_glob(dev_priv), size, &ctx);
 +}
 +
 +/* struct vmw_validation_mem callback */
 +static void vmw_vmt_unreserve(struct vmw_validation_mem *m, size_t size)
 +{
 +	struct vmw_private *dev_priv = container_of(m, struct vmw_private, vvm);
 +
 +	return ttm_mem_global_free(vmw_mem_glob(dev_priv), size);
 +}
 +
 +/**
 + * vmw_validation_mem_init_ttm - Interface the validation memory tracker
 + * to ttm.
 + * @dev_priv: Pointer to struct vmw_private. The reason we choose a vmw private
 + * rather than a struct vmw_validation_mem is to make sure assumption in the
 + * callbacks that struct vmw_private derives from struct vmw_validation_mem
 + * holds true.
 + * @gran: The recommended allocation granularity
 + */
 +void vmw_validation_mem_init_ttm(struct vmw_private *dev_priv, size_t gran)
 +{
 +	struct vmw_validation_mem *vvm = &dev_priv->vvm;
 +
 +	vvm->reserve_mem = vmw_vmt_reserve;
 +	vvm->unreserve_mem = vmw_vmt_unreserve;
 +	vvm->gran = gran;
 +}

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2018-12-14  1:51 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-14  1:51 Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-04-03 13:33 linux-next: manual merge of the drm tree with the drm-fixes tree Mark Brown
2026-03-27 20:52 Mark Brown
2026-03-27 20:46 Mark Brown
2026-03-09 14:35 Mark Brown
2026-03-06 13:47 Mark Brown
2026-03-06 13:47 Mark Brown
2026-01-30 15:37 Mark Brown
2026-01-30 15:28 Mark Brown
2026-01-23 17:45 Mark Brown
2025-06-27  2:58 Stephen Rothwell
2024-10-18  1:56 Stephen Rothwell
2024-06-27 15:08 Mark Brown
2024-06-27 15:00 Mark Brown
2024-06-21 13:21 Mark Brown
2023-08-18  1:53 Stephen Rothwell
2023-02-13  0:23 Stephen Rothwell
2022-09-26 17:49 broonie
2022-02-25 16:37 broonie
2022-02-24 16:33 broonie
2021-08-06 12:04 Mark Brown
2021-08-10 11:56 ` Geert Uytterhoeven
2021-08-10 12:53   ` Stephen Rothwell
2020-07-10  2:28 Stephen Rothwell
2019-08-23  3:20 Stephen Rothwell
2019-07-05  2:50 Stephen Rothwell
2019-03-01  2:23 Stephen Rothwell
2019-03-01 23:29 ` Alex Deucher
2019-03-04  0:54   ` Stephen Rothwell
2019-03-11 12:36     ` Daniel Vetter
2018-12-07  2:38 Stephen Rothwell
2018-12-07  2:31 Stephen Rothwell

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=20181214125143.3ecb367b@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=thellstrom@vmware.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