From: Damien Lespiau <damien.lespiau@intel.com>
To: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: [PATCH 2/5] drm: Remove dev_priv_size from struct drm_buf
Date: Wed, 8 Jan 2014 18:31:49 +0000 [thread overview]
Message-ID: <1389205912-16632-3-git-send-email-damien.lespiau@intel.com> (raw)
In-Reply-To: <1389205912-16632-1-git-send-email-damien.lespiau@intel.com>
This field is only used when creating a new buffer and can already be
found in the drm_driver structure, so no need to duplicate the
information for every buffer.
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
drivers/gpu/drm/drm_bufs.c | 13 ++++++-------
include/drm/drmP.h | 1 -
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c
index edec31f..3bf8cc5 100644
--- a/drivers/gpu/drm/drm_bufs.c
+++ b/drivers/gpu/drm/drm_bufs.c
@@ -705,8 +705,8 @@ int drm_addbufs_agp(struct drm_device * dev, struct drm_buf_desc * request)
buf->pending = 0;
buf->file_priv = NULL;
- buf->dev_priv_size = dev->driver->dev_priv_size;
- buf->dev_private = kzalloc(buf->dev_priv_size, GFP_KERNEL);
+ buf->dev_private = kzalloc(dev->driver->dev_priv_size,
+ GFP_KERNEL);
if (!buf->dev_private) {
/* Set count correctly so we free the proper amount. */
entry->buf_count = count;
@@ -902,9 +902,8 @@ int drm_addbufs_pci(struct drm_device * dev, struct drm_buf_desc * request)
buf->pending = 0;
buf->file_priv = NULL;
- buf->dev_priv_size = dev->driver->dev_priv_size;
- buf->dev_private = kzalloc(buf->dev_priv_size,
- GFP_KERNEL);
+ buf->dev_private = kzalloc(dev->driver->dev_priv_size,
+ GFP_KERNEL);
if (!buf->dev_private) {
/* Set count correctly so we free the proper amount. */
entry->buf_count = count;
@@ -1066,8 +1065,8 @@ static int drm_addbufs_sg(struct drm_device * dev, struct drm_buf_desc * request
buf->pending = 0;
buf->file_priv = NULL;
- buf->dev_priv_size = dev->driver->dev_priv_size;
- buf->dev_private = kzalloc(buf->dev_priv_size, GFP_KERNEL);
+ buf->dev_private = kzalloc(dev->driver->dev_priv_size,
+ GFP_KERNEL);
if (!buf->dev_private) {
/* Set count correctly so we free the proper amount. */
entry->buf_count = count;
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 2fe9b5d..2274274 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -364,7 +364,6 @@ struct drm_buf {
DRM_LIST_RECLAIM = 5
} list; /**< Which list we're on */
- int dev_priv_size; /**< Size of buffer private storage */
void *dev_private; /**< Per-buffer private storage */
};
--
1.8.3.1
next prev parent reply other threads:[~2014-01-08 18:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-08 18:31 [RFC] Subclassing struct drm_device Damien Lespiau
2014-01-08 18:31 ` [PATCH 1/5] drm: Remove unnecessary dev_priv_size initializations to 0 Damien Lespiau
2014-01-08 18:31 ` Damien Lespiau [this message]
2014-01-08 18:31 ` [PATCH 3/5] drm: Rename dev_priv_size to buf_priv_size Damien Lespiau
2014-01-08 18:31 ` [PATCH 4/5] drm: Add support for subclassing struct drm_device Damien Lespiau
2014-01-08 19:01 ` David Herrmann
2014-01-08 20:26 ` Daniel Vetter
2014-01-09 12:11 ` Damien Lespiau
2014-01-09 12:18 ` David Herrmann
2014-01-08 18:31 ` [PATCH 5/5] drm/i915: Make struct drm_i915_private a subclass of " Damien Lespiau
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=1389205912-16632-3-git-send-email-damien.lespiau@intel.com \
--to=damien.lespiau@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--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