From patchwork Mon Aug 24 16:34:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 7065611 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EA67EC05AE for ; Mon, 24 Aug 2015 16:30:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EC5E420789 for ; Mon, 24 Aug 2015 16:30:23 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id F024320783 for ; Mon, 24 Aug 2015 16:30:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0317E6EA03; Mon, 24 Aug 2015 09:30:21 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9317E6E9FB; Mon, 24 Aug 2015 09:30:15 -0700 (PDT) Received: by wicja10 with SMTP id ja10so77069405wic.1; Mon, 24 Aug 2015 09:30:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=P6WhCktjfVn8qBSX1RwP9z2jJz3eiFfD9AaVa0gEL6A=; b=GG1sgUMlRpw5EqPITtjYsyT7JaQCvQEqBlghbRKuDf136BHbX3/EnFj/lbrz58cSwY LPJvUvlCFzRjYgAyICNslmGvSLRyNwiqombatJlN3N6eN5Valt6+K7XHaXb3Td5Dta+p fIrZ0lH1pniW/iEOcvwY80QQrQLihRxcB8/+8BA1p0iLjtqB+phMh1SKfv1szBVu7u1j 4KhuxlgntViy52ezWzIhkBa+dt2uNUHpNObshQ9Mise5F6hU9QhIqTs2S68TDx01iszO urEDl5driwdKqDvlgCb7xNWlZY+2ebRGqAVAzYCFSApNpcO6LJ6EVMogu/yraznInwkw QaAQ== X-Received: by 10.194.93.198 with SMTP id cw6mr43088951wjb.113.1440433814222; Mon, 24 Aug 2015 09:30:14 -0700 (PDT) Received: from arch-x220.localdomain (cpc12-croy20-2-0-cust52.croy.cable.virginm.net. [82.44.54.53]) by smtp.gmail.com with ESMTPSA id ll1sm16885984wic.14.2015.08.24.09.30.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Aug 2015 09:30:13 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 10/17] freedreno: annotate the device/bo/pipe/ringbuffer funcs as const data Date: Mon, 24 Aug 2015 17:34:13 +0100 Message-Id: <1440434060-31347-10-git-send-email-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1440434060-31347-1-git-send-email-emil.l.velikov@gmail.com> References: <1440434060-31347-1-git-send-email-emil.l.velikov@gmail.com> Cc: freedreno@lists.freedesktop.org, emil.l.velikov@gmail.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Cc: freedreno@lists.freedesktop.org Signed-off-by: Emil Velikov --- freedreno/freedreno_priv.h | 6 +++--- freedreno/freedreno_ringbuffer.h | 2 +- freedreno/kgsl/kgsl_bo.c | 2 +- freedreno/kgsl/kgsl_device.c | 2 +- freedreno/kgsl/kgsl_pipe.c | 2 +- freedreno/kgsl/kgsl_ringbuffer.c | 2 +- freedreno/msm/msm_bo.c | 2 +- freedreno/msm/msm_device.c | 2 +- freedreno/msm/msm_pipe.c | 2 +- freedreno/msm/msm_ringbuffer.c | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/freedreno/freedreno_priv.h b/freedreno/freedreno_priv.h index 1dddcc3..4e442e4 100644 --- a/freedreno/freedreno_priv.h +++ b/freedreno/freedreno_priv.h @@ -83,7 +83,7 @@ struct fd_device { */ void *handle_table, *name_table; - struct fd_device_funcs *funcs; + const struct fd_device_funcs *funcs; struct fd_bo_bucket cache_bucket[14 * 4]; int num_buckets; @@ -107,7 +107,7 @@ struct fd_pipe_funcs { struct fd_pipe { struct fd_device *dev; enum fd_pipe_id id; - struct fd_pipe_funcs *funcs; + const struct fd_pipe_funcs *funcs; }; struct fd_ringmarker { @@ -141,7 +141,7 @@ struct fd_bo { int fd; /* dmabuf handle */ void *map; atomic_t refcnt; - struct fd_bo_funcs *funcs; + const struct fd_bo_funcs *funcs; int bo_reuse; struct list_head list; /* bucket-list entry */ diff --git a/freedreno/freedreno_ringbuffer.h b/freedreno/freedreno_ringbuffer.h index a5e1d03..578cdb2 100644 --- a/freedreno/freedreno_ringbuffer.h +++ b/freedreno/freedreno_ringbuffer.h @@ -44,7 +44,7 @@ struct fd_ringbuffer { int size; uint32_t *cur, *end, *start, *last_start; struct fd_pipe *pipe; - struct fd_ringbuffer_funcs *funcs; + const struct fd_ringbuffer_funcs *funcs; uint32_t last_timestamp; struct fd_ringbuffer *parent; }; diff --git a/freedreno/kgsl/kgsl_bo.c b/freedreno/kgsl/kgsl_bo.c index 3407c76..b8ac102 100644 --- a/freedreno/kgsl/kgsl_bo.c +++ b/freedreno/kgsl/kgsl_bo.c @@ -123,7 +123,7 @@ static void kgsl_bo_destroy(struct fd_bo *bo) } -static struct fd_bo_funcs funcs = { +static const struct fd_bo_funcs funcs = { .offset = kgsl_bo_offset, .cpu_prep = kgsl_bo_cpu_prep, .cpu_fini = kgsl_bo_cpu_fini, diff --git a/freedreno/kgsl/kgsl_device.c b/freedreno/kgsl/kgsl_device.c index 8352d60..175e837 100644 --- a/freedreno/kgsl/kgsl_device.c +++ b/freedreno/kgsl/kgsl_device.c @@ -42,7 +42,7 @@ static void kgsl_device_destroy(struct fd_device *dev) free(kgsl_dev); } -static struct fd_device_funcs funcs = { +static const struct fd_device_funcs funcs = { .bo_new_handle = kgsl_bo_new_handle, .bo_from_handle = kgsl_bo_from_handle, .pipe_new = kgsl_pipe_new, diff --git a/freedreno/kgsl/kgsl_pipe.c b/freedreno/kgsl/kgsl_pipe.c index e2fd65c..58b3b4d 100644 --- a/freedreno/kgsl/kgsl_pipe.c +++ b/freedreno/kgsl/kgsl_pipe.c @@ -108,7 +108,7 @@ static void kgsl_pipe_destroy(struct fd_pipe *pipe) free(kgsl_pipe); } -static struct fd_pipe_funcs funcs = { +static const struct fd_pipe_funcs funcs = { .ringbuffer_new = kgsl_ringbuffer_new, .get_param = kgsl_pipe_get_param, .wait = kgsl_pipe_wait, diff --git a/freedreno/kgsl/kgsl_ringbuffer.c b/freedreno/kgsl/kgsl_ringbuffer.c index f013307..6f68f2f 100644 --- a/freedreno/kgsl/kgsl_ringbuffer.c +++ b/freedreno/kgsl/kgsl_ringbuffer.c @@ -191,7 +191,7 @@ static void kgsl_ringbuffer_destroy(struct fd_ringbuffer *ring) free(kgsl_ring); } -static struct fd_ringbuffer_funcs funcs = { +static const struct fd_ringbuffer_funcs funcs = { .hostptr = kgsl_ringbuffer_hostptr, .flush = kgsl_ringbuffer_flush, .emit_reloc = kgsl_ringbuffer_emit_reloc, diff --git a/freedreno/msm/msm_bo.c b/freedreno/msm/msm_bo.c index fd94413..ee668ab 100644 --- a/freedreno/msm/msm_bo.c +++ b/freedreno/msm/msm_bo.c @@ -96,7 +96,7 @@ static void msm_bo_destroy(struct fd_bo *bo) } -static struct fd_bo_funcs funcs = { +static const struct fd_bo_funcs funcs = { .offset = msm_bo_offset, .cpu_prep = msm_bo_cpu_prep, .cpu_fini = msm_bo_cpu_fini, diff --git a/freedreno/msm/msm_device.c b/freedreno/msm/msm_device.c index 81077e1..25c097c 100644 --- a/freedreno/msm/msm_device.c +++ b/freedreno/msm/msm_device.c @@ -42,7 +42,7 @@ static void msm_device_destroy(struct fd_device *dev) free(msm_dev); } -static struct fd_device_funcs funcs = { +static const struct fd_device_funcs funcs = { .bo_new_handle = msm_bo_new_handle, .bo_from_handle = msm_bo_from_handle, .pipe_new = msm_pipe_new, diff --git a/freedreno/msm/msm_pipe.c b/freedreno/msm/msm_pipe.c index e1edffe..aa0866b 100644 --- a/freedreno/msm/msm_pipe.c +++ b/freedreno/msm/msm_pipe.c @@ -80,7 +80,7 @@ static void msm_pipe_destroy(struct fd_pipe *pipe) free(msm_pipe); } -static struct fd_pipe_funcs funcs = { +static const struct fd_pipe_funcs funcs = { .ringbuffer_new = msm_ringbuffer_new, .get_param = msm_pipe_get_param, .wait = msm_pipe_wait, diff --git a/freedreno/msm/msm_ringbuffer.c b/freedreno/msm/msm_ringbuffer.c index 5ddea57..ee6af0b 100644 --- a/freedreno/msm/msm_ringbuffer.c +++ b/freedreno/msm/msm_ringbuffer.c @@ -356,7 +356,7 @@ static void msm_ringbuffer_destroy(struct fd_ringbuffer *ring) free(msm_ring); } -static struct fd_ringbuffer_funcs funcs = { +static const struct fd_ringbuffer_funcs funcs = { .hostptr = msm_ringbuffer_hostptr, .flush = msm_ringbuffer_flush, .reset = msm_ringbuffer_reset,