On 10/1/2018 11:43 PM, Jordan Crouse wrote:
On Mon, Oct 01, 2018 at 06:01:38PM +0530, Sharat Masetty wrote:
This patch changes to kzalloc and avoids setting individual submit
struct fields to zero manually.

I don't think this one is worth it.  There are so many members in submit and so
few that get reset to 0 - I don't think the extra cycles are worth it in this
fast path.
The patch "drm/msm: Use the DRM common Scheduler" adds a few more fields to the bo struct, If not kzalloc, then I will have to run a loop or memset the bos area to 0 at least.

Signed-off-by: Sharat Masetty <smase...@codeaurora.org>
---
  drivers/gpu/drm/msm/msm_gem_submit.c | 7 +------
  1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c 
b/drivers/gpu/drm/msm/msm_gem_submit.c
index a7c8cbc..7931c2a 100644
--- a/drivers/gpu/drm/msm/msm_gem_submit.c
+++ b/drivers/gpu/drm/msm/msm_gem_submit.c
@@ -41,24 +41,19 @@ static struct msm_gem_submit *submit_create(struct 
drm_device *dev,
        if (sz > SIZE_MAX)
                return NULL;
- submit = kmalloc(sz, GFP_KERNEL | __GFP_NOWARN | __GFP_NORETRY);
+       submit = kzalloc(sz, GFP_KERNEL | __GFP_NOWARN | __GFP_NORETRY);
        if (!submit)
                return NULL;
submit->dev = dev;
        submit->gpu = gpu;
        submit->ctx = ctx;
-       submit->hw_fence = NULL;
        submit->out_fence_id = -1;
        submit->pid = get_pid(task_pid(current));
        submit->cmd = (void *)&submit->bos[nr_bos];
        submit->queue = queue;
        submit->ring = gpu->rb[queue->prio];
- /* initially, until copy_from_user() and bo lookup succeeds: */
-       submit->nr_bos = 0;
-       submit->nr_cmds = 0;
-
        INIT_LIST_HEAD(&submit->node);
        INIT_LIST_HEAD(&submit->bo_list);
        ww_acquire_init(&submit->ticket, &reservation_ww_class);
--
1.9.1



--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
Linux Foundation Collaborative Project
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to