@@ -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;
@@ -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 */
};
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(-)