public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Damien Lespiau <damien.lespiau@intel.com>
To: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: [PATCH 3/5] drm: Rename dev_priv_size to buf_priv_size
Date: Wed,  8 Jan 2014 18:31:50 +0000	[thread overview]
Message-ID: <1389205912-16632-4-git-send-email-damien.lespiau@intel.com> (raw)
In-Reply-To: <1389205912-16632-1-git-send-email-damien.lespiau@intel.com>

This field is really the size of the per-driver private data attached to
a struct drm_buf. Name it accordingly and add a comment so it doesn't
get confused with, say, the size of the private data attatched to a struct
drm_device.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/drm_bufs.c          | 6 +++---
 drivers/gpu/drm/i810/i810_drv.c     | 2 +-
 drivers/gpu/drm/mga/mga_drv.c       | 2 +-
 drivers/gpu/drm/r128/r128_drv.c     | 2 +-
 drivers/gpu/drm/radeon/radeon_drv.c | 2 +-
 drivers/gpu/drm/savage/savage_drv.c | 2 +-
 include/drm/drmP.h                  | 3 ++-
 7 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c
index 3bf8cc5..a4e3ab0 100644
--- a/drivers/gpu/drm/drm_bufs.c
+++ b/drivers/gpu/drm/drm_bufs.c
@@ -705,7 +705,7 @@ int drm_addbufs_agp(struct drm_device * dev, struct drm_buf_desc * request)
 		buf->pending = 0;
 		buf->file_priv = NULL;
 
-		buf->dev_private = kzalloc(dev->driver->dev_priv_size,
+		buf->dev_private = kzalloc(dev->driver->buf_priv_size,
 					   GFP_KERNEL);
 		if (!buf->dev_private) {
 			/* Set count correctly so we free the proper amount. */
@@ -902,7 +902,7 @@ int drm_addbufs_pci(struct drm_device * dev, struct drm_buf_desc * request)
 			buf->pending = 0;
 			buf->file_priv = NULL;
 
-			buf->dev_private = kzalloc(dev->driver->dev_priv_size,
+			buf->dev_private = kzalloc(dev->driver->buf_priv_size,
 						   GFP_KERNEL);
 			if (!buf->dev_private) {
 				/* Set count correctly so we free the proper amount. */
@@ -1065,7 +1065,7 @@ static int drm_addbufs_sg(struct drm_device * dev, struct drm_buf_desc * request
 		buf->pending = 0;
 		buf->file_priv = NULL;
 
-		buf->dev_private = kzalloc(dev->driver->dev_priv_size,
+		buf->dev_private = kzalloc(dev->driver->buf_priv_size,
 					   GFP_KERNEL);
 		if (!buf->dev_private) {
 			/* Set count correctly so we free the proper amount. */
diff --git a/drivers/gpu/drm/i810/i810_drv.c b/drivers/gpu/drm/i810/i810_drv.c
index 441ccf8..b70a4fe 100644
--- a/drivers/gpu/drm/i810/i810_drv.c
+++ b/drivers/gpu/drm/i810/i810_drv.c
@@ -59,7 +59,7 @@ static struct drm_driver driver = {
 	.driver_features =
 	    DRIVER_USE_AGP |
 	    DRIVER_HAVE_DMA,
-	.dev_priv_size = sizeof(drm_i810_buf_priv_t),
+	.buf_priv_size = sizeof(drm_i810_buf_priv_t),
 	.load = i810_driver_load,
 	.lastclose = i810_driver_lastclose,
 	.preclose = i810_driver_preclose,
diff --git a/drivers/gpu/drm/mga/mga_drv.c b/drivers/gpu/drm/mga/mga_drv.c
index 6b1a87c..bdb44c4 100644
--- a/drivers/gpu/drm/mga/mga_drv.c
+++ b/drivers/gpu/drm/mga/mga_drv.c
@@ -60,7 +60,7 @@ static struct drm_driver driver = {
 	.driver_features =
 	    DRIVER_USE_AGP | DRIVER_PCI_DMA |
 	    DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED,
-	.dev_priv_size = sizeof(drm_mga_buf_priv_t),
+	.buf_priv_size = sizeof(drm_mga_buf_priv_t),
 	.load = mga_driver_load,
 	.unload = mga_driver_unload,
 	.lastclose = mga_driver_lastclose,
diff --git a/drivers/gpu/drm/r128/r128_drv.c b/drivers/gpu/drm/r128/r128_drv.c
index 5bd307c..09b2a73 100644
--- a/drivers/gpu/drm/r128/r128_drv.c
+++ b/drivers/gpu/drm/r128/r128_drv.c
@@ -58,7 +58,7 @@ static struct drm_driver driver = {
 	.driver_features =
 	    DRIVER_USE_AGP | DRIVER_PCI_DMA | DRIVER_SG |
 	    DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED,
-	.dev_priv_size = sizeof(drm_r128_buf_priv_t),
+	.buf_priv_size = sizeof(drm_r128_buf_priv_t),
 	.load = r128_driver_load,
 	.preclose = r128_driver_preclose,
 	.lastclose = r128_driver_lastclose,
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index 394e0a3..2afd583 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -287,7 +287,7 @@ static struct drm_driver driver_old = {
 	.driver_features =
 	    DRIVER_USE_AGP | DRIVER_PCI_DMA | DRIVER_SG |
 	    DRIVER_HAVE_IRQ | DRIVER_HAVE_DMA | DRIVER_IRQ_SHARED,
-	.dev_priv_size = sizeof(drm_radeon_buf_priv_t),
+	.buf_priv_size = sizeof(drm_radeon_buf_priv_t),
 	.load = radeon_driver_load,
 	.firstopen = radeon_driver_firstopen,
 	.open = radeon_driver_open,
diff --git a/drivers/gpu/drm/savage/savage_drv.c b/drivers/gpu/drm/savage/savage_drv.c
index 3c03021..92c5b64 100644
--- a/drivers/gpu/drm/savage/savage_drv.c
+++ b/drivers/gpu/drm/savage/savage_drv.c
@@ -51,7 +51,7 @@ static const struct file_operations savage_driver_fops = {
 static struct drm_driver driver = {
 	.driver_features =
 	    DRIVER_USE_AGP | DRIVER_HAVE_DMA | DRIVER_PCI_DMA,
-	.dev_priv_size = sizeof(drm_savage_buf_priv_t),
+	.buf_priv_size = sizeof(drm_savage_buf_priv_t),
 	.load = savage_driver_load,
 	.firstopen = savage_driver_firstopen,
 	.preclose = savage_reclaim_buffers,
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 2274274..6800c20 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -994,7 +994,8 @@ struct drm_driver {
 	char *date;
 
 	u32 driver_features;
-	int dev_priv_size;
+	/* size of the private data attached to a struct drm_buf */
+	int buf_priv_size;
 	const struct drm_ioctl_desc *ioctls;
 	int num_ioctls;
 	const struct file_operations *fops;
-- 
1.8.3.1

  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 ` [PATCH 2/5] drm: Remove dev_priv_size from struct drm_buf Damien Lespiau
2014-01-08 18:31 ` Damien Lespiau [this message]
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-4-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