summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tegra
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/tegra')
-rw-r--r--drivers/gpu/drm/tegra/dc.c10
-rw-r--r--drivers/gpu/drm/tegra/drm.c8
-rw-r--r--drivers/gpu/drm/tegra/dsi.c2
-rw-r--r--drivers/gpu/drm/tegra/fb.c2
-rw-r--r--drivers/gpu/drm/tegra/gem.c10
-rw-r--r--drivers/gpu/drm/tegra/hub.c4
-rw-r--r--drivers/gpu/drm/tegra/plane.c4
-rw-r--r--drivers/gpu/drm/tegra/sor.c2
-rw-r--r--drivers/gpu/drm/tegra/submit.c10
-rw-r--r--drivers/gpu/drm/tegra/uapi.c4
10 files changed, 28 insertions, 28 deletions
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index 01e9d5011dd8..21cadb50c671 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -812,7 +812,7 @@ static struct drm_plane *tegra_primary_plane_create(struct drm_device *drm,
const u32 *formats;
int err;
- plane = kzalloc(sizeof(*plane), GFP_KERNEL);
+ plane = kzalloc_obj(*plane, GFP_KERNEL);
if (!plane)
return ERR_PTR(-ENOMEM);
@@ -1115,7 +1115,7 @@ static struct drm_plane *tegra_dc_cursor_plane_create(struct drm_device *drm,
const u32 *formats;
int err;
- plane = kzalloc(sizeof(*plane), GFP_KERNEL);
+ plane = kzalloc_obj(*plane, GFP_KERNEL);
if (!plane)
return ERR_PTR(-ENOMEM);
@@ -1263,7 +1263,7 @@ static struct drm_plane *tegra_dc_overlay_plane_create(struct drm_device *drm,
const u32 *formats;
int err;
- plane = kzalloc(sizeof(*plane), GFP_KERNEL);
+ plane = kzalloc_obj(*plane, GFP_KERNEL);
if (!plane)
return ERR_PTR(-ENOMEM);
@@ -1389,7 +1389,7 @@ static void tegra_dc_destroy(struct drm_crtc *crtc)
static void tegra_crtc_reset(struct drm_crtc *crtc)
{
- struct tegra_dc_state *state = kzalloc(sizeof(*state), GFP_KERNEL);
+ struct tegra_dc_state *state = kzalloc_obj(*state, GFP_KERNEL);
if (crtc->state)
tegra_crtc_atomic_destroy_state(crtc, crtc->state);
@@ -1406,7 +1406,7 @@ tegra_crtc_atomic_duplicate_state(struct drm_crtc *crtc)
struct tegra_dc_state *state = to_dc_state(crtc->state);
struct tegra_dc_state *copy;
- copy = kmalloc(sizeof(*copy), GFP_KERNEL);
+ copy = kmalloc_obj(*copy, GFP_KERNEL);
if (!copy)
return NULL;
diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index f7222819d672..1d1bbeae4522 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -104,7 +104,7 @@ static int tegra_drm_open(struct drm_device *drm, struct drm_file *filp)
{
struct tegra_drm_file *fpriv;
- fpriv = kzalloc(sizeof(*fpriv), GFP_KERNEL);
+ fpriv = kzalloc_obj(*fpriv, GFP_KERNEL);
if (!fpriv)
return -ENOMEM;
@@ -212,7 +212,7 @@ int tegra_drm_submit(struct tegra_drm_context *context,
*/
num_refs = num_cmdbufs + num_relocs * 2;
- refs = kmalloc_array(num_refs, sizeof(*refs), GFP_KERNEL);
+ refs = kmalloc_objs(*refs, num_refs, GFP_KERNEL);
if (!refs) {
err = -ENOMEM;
goto put;
@@ -465,7 +465,7 @@ static int tegra_open_channel(struct drm_device *drm, void *data,
struct tegra_drm_client *client;
int err = -ENODEV;
- context = kzalloc(sizeof(*context), GFP_KERNEL);
+ context = kzalloc_obj(*context, GFP_KERNEL);
if (!context)
return -ENOMEM;
@@ -1147,7 +1147,7 @@ static int host1x_drm_probe(struct host1x_device *dev)
if (IS_ERR(drm))
return PTR_ERR(drm);
- tegra = kzalloc(sizeof(*tegra), GFP_KERNEL);
+ tegra = kzalloc_obj(*tegra, GFP_KERNEL);
if (!tegra) {
err = -ENOMEM;
goto put;
diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c
index 8ee96b59fdbc..f28e7bd63508 100644
--- a/drivers/gpu/drm/tegra/dsi.c
+++ b/drivers/gpu/drm/tegra/dsi.c
@@ -772,7 +772,7 @@ static void tegra_dsi_soft_reset(struct tegra_dsi *dsi)
static void tegra_dsi_connector_reset(struct drm_connector *connector)
{
- struct tegra_dsi_state *state = kzalloc(sizeof(*state), GFP_KERNEL);
+ struct tegra_dsi_state *state = kzalloc_obj(*state, GFP_KERNEL);
if (!state)
return;
diff --git a/drivers/gpu/drm/tegra/fb.c b/drivers/gpu/drm/tegra/fb.c
index 1cef8c5cac50..e795570776fd 100644
--- a/drivers/gpu/drm/tegra/fb.c
+++ b/drivers/gpu/drm/tegra/fb.c
@@ -112,7 +112,7 @@ struct drm_framebuffer *tegra_fb_alloc(struct drm_device *drm,
unsigned int i;
int err;
- fb = kzalloc(sizeof(*fb), GFP_KERNEL);
+ fb = kzalloc_obj(*fb, GFP_KERNEL);
if (!fb)
return ERR_PTR(-ENOMEM);
diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
index 6b14f1e919eb..c7355b11424c 100644
--- a/drivers/gpu/drm/tegra/gem.c
+++ b/drivers/gpu/drm/tegra/gem.c
@@ -64,7 +64,7 @@ static struct host1x_bo_mapping *tegra_bo_pin(struct device *dev, struct host1x_
struct host1x_bo_mapping *map;
int err;
- map = kzalloc(sizeof(*map), GFP_KERNEL);
+ map = kzalloc_obj(*map, GFP_KERNEL);
if (!map)
return ERR_PTR(-ENOMEM);
@@ -103,7 +103,7 @@ static struct host1x_bo_mapping *tegra_bo_pin(struct device *dev, struct host1x_
* If we don't have a mapping for this buffer yet, return an SG table
* so that host1x can do the mapping for us via the DMA API.
*/
- map->sgt = kzalloc(sizeof(*map->sgt), GFP_KERNEL);
+ map->sgt = kzalloc_obj(*map->sgt, GFP_KERNEL);
if (!map->sgt) {
err = -ENOMEM;
goto free;
@@ -240,7 +240,7 @@ static int tegra_bo_iommu_map(struct tegra_drm *tegra, struct tegra_bo *bo)
if (bo->mm)
return -EBUSY;
- bo->mm = kzalloc(sizeof(*bo->mm), GFP_KERNEL);
+ bo->mm = kzalloc_obj(*bo->mm, GFP_KERNEL);
if (!bo->mm)
return -ENOMEM;
@@ -302,7 +302,7 @@ static struct tegra_bo *tegra_bo_alloc_object(struct drm_device *drm,
struct tegra_bo *bo;
int err;
- bo = kzalloc(sizeof(*bo), GFP_KERNEL);
+ bo = kzalloc_obj(*bo, GFP_KERNEL);
if (!bo)
return ERR_PTR(-ENOMEM);
@@ -639,7 +639,7 @@ tegra_gem_prime_map_dma_buf(struct dma_buf_attachment *attach,
struct tegra_bo *bo = to_tegra_bo(gem);
struct sg_table *sgt;
- sgt = kmalloc(sizeof(*sgt), GFP_KERNEL);
+ sgt = kmalloc_obj(*sgt, GFP_KERNEL);
if (!sgt)
return NULL;
diff --git a/drivers/gpu/drm/tegra/hub.c b/drivers/gpu/drm/tegra/hub.c
index c924ffba4094..e0f84efb3b76 100644
--- a/drivers/gpu/drm/tegra/hub.c
+++ b/drivers/gpu/drm/tegra/hub.c
@@ -769,7 +769,7 @@ struct drm_plane *tegra_shared_plane_create(struct drm_device *drm,
const u32 *formats;
int err;
- plane = kzalloc(sizeof(*plane), GFP_KERNEL);
+ plane = kzalloc_obj(*plane, GFP_KERNEL);
if (!plane)
return ERR_PTR(-ENOMEM);
@@ -943,7 +943,7 @@ static int tegra_display_hub_init(struct host1x_client *client)
struct tegra_drm *tegra = drm->dev_private;
struct tegra_display_hub_state *state;
- state = kzalloc(sizeof(*state), GFP_KERNEL);
+ state = kzalloc_obj(*state, GFP_KERNEL);
if (!state)
return -ENOMEM;
diff --git a/drivers/gpu/drm/tegra/plane.c b/drivers/gpu/drm/tegra/plane.c
index ffe5f06b770d..ce49c2de2c08 100644
--- a/drivers/gpu/drm/tegra/plane.c
+++ b/drivers/gpu/drm/tegra/plane.c
@@ -36,7 +36,7 @@ static void tegra_plane_reset(struct drm_plane *plane)
kfree(plane->state);
plane->state = NULL;
- state = kzalloc(sizeof(*state), GFP_KERNEL);
+ state = kzalloc_obj(*state, GFP_KERNEL);
if (state) {
plane->state = &state->base;
plane->state->plane = plane;
@@ -55,7 +55,7 @@ tegra_plane_atomic_duplicate_state(struct drm_plane *plane)
struct tegra_plane_state *copy;
unsigned int i;
- copy = kmalloc(sizeof(*copy), GFP_KERNEL);
+ copy = kmalloc_obj(*copy, GFP_KERNEL);
if (!copy)
return NULL;
diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
index 4023cb5998f1..a2cb68f42612 100644
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/drm/tegra/sor.c
@@ -1721,7 +1721,7 @@ static void tegra_sor_connector_reset(struct drm_connector *connector)
{
struct tegra_sor_state *state;
- state = kzalloc(sizeof(*state), GFP_KERNEL);
+ state = kzalloc_obj(*state, GFP_KERNEL);
if (!state)
return;
diff --git a/drivers/gpu/drm/tegra/submit.c b/drivers/gpu/drm/tegra/submit.c
index 2430fcc97448..7747d5b9f3ca 100644
--- a/drivers/gpu/drm/tegra/submit.c
+++ b/drivers/gpu/drm/tegra/submit.c
@@ -71,7 +71,7 @@ gather_bo_pin(struct device *dev, struct host1x_bo *bo, enum dma_data_direction
struct host1x_bo_mapping *map;
int err;
- map = kzalloc(sizeof(*map), GFP_KERNEL);
+ map = kzalloc_obj(*map, GFP_KERNEL);
if (!map)
return ERR_PTR(-ENOMEM);
@@ -80,7 +80,7 @@ gather_bo_pin(struct device *dev, struct host1x_bo *bo, enum dma_data_direction
map->direction = direction;
map->dev = dev;
- map->sgt = kzalloc(sizeof(*map->sgt), GFP_KERNEL);
+ map->sgt = kzalloc_obj(*map->sgt, GFP_KERNEL);
if (!map->sgt) {
err = -ENOMEM;
goto free;
@@ -193,7 +193,7 @@ static int submit_copy_gather_data(struct gather_bo **pbo, struct device *dev,
return -EINVAL;
}
- bo = kzalloc(sizeof(*bo), GFP_KERNEL);
+ bo = kzalloc_obj(*bo, GFP_KERNEL);
if (!bo) {
SUBMIT_ERR(context, "failed to allocate memory for bo info");
return -ENOMEM;
@@ -270,7 +270,7 @@ static int submit_process_bufs(struct tegra_drm_context *context, struct gather_
return PTR_ERR(bufs);
}
- mappings = kcalloc(args->num_bufs, sizeof(*mappings), GFP_KERNEL);
+ mappings = kzalloc_objs(*mappings, args->num_bufs, GFP_KERNEL);
if (!mappings) {
SUBMIT_ERR(context, "failed to allocate memory for mapping info");
err = -ENOMEM;
@@ -560,7 +560,7 @@ int tegra_drm_ioctl_channel_submit(struct drm_device *drm, void *data,
if (err)
goto unlock;
- job_data = kzalloc(sizeof(*job_data), GFP_KERNEL);
+ job_data = kzalloc_obj(*job_data, GFP_KERNEL);
if (!job_data) {
SUBMIT_ERR(context, "failed to allocate memory for job data");
err = -ENOMEM;
diff --git a/drivers/gpu/drm/tegra/uapi.c b/drivers/gpu/drm/tegra/uapi.c
index d0b6a1fa6efa..c4061d0f69a7 100644
--- a/drivers/gpu/drm/tegra/uapi.c
+++ b/drivers/gpu/drm/tegra/uapi.c
@@ -86,7 +86,7 @@ int tegra_drm_ioctl_channel_open(struct drm_device *drm, void *data, struct drm_
if (args->flags)
return -EINVAL;
- context = kzalloc(sizeof(*context), GFP_KERNEL);
+ context = kzalloc_obj(*context, GFP_KERNEL);
if (!context)
return -ENOMEM;
@@ -206,7 +206,7 @@ int tegra_drm_ioctl_channel_map(struct drm_device *drm, void *data, struct drm_f
return -EINVAL;
}
- mapping = kzalloc(sizeof(*mapping), GFP_KERNEL);
+ mapping = kzalloc_obj(*mapping, GFP_KERNEL);
if (!mapping) {
err = -ENOMEM;
goto unlock;