From 66a2511a366113fa4d42dc500c9df9b348d9f208 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Tue, 23 May 2017 18:21:14 +0100 Subject: gpu: nvgpu: Begin removing variables in struct gk20a Begin removing all of the myriad flag variables in struct gk20a and replace that with one API that checks for flags being enabled or disabled. The API is as follows: bool nvgpu_is_enabled(struct gk20a *g, int flag); bool __nvgpu_set_enabled(struct gk20a *g, int flag, bool state); These APIs allow many of the gk20a flags to be replaced by defines. This makes flag usage consistent and saves a small amount of memory in struct gk20a. Also it makes struct gk20a easier to read since there's less clutter scattered through out. JIRA NVGPU-84 Change-Id: I6525cecbe97c4e8379e5f53e29ef0b4dbd1a7fc2 Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1488049 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 10417084..689fafb1 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -1,8 +1,8 @@ /* - * GK20A Graphics - * * Copyright (c) 2011-2017, NVIDIA CORPORATION. All rights reserved. * + * GK20A Graphics + * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. @@ -971,15 +971,17 @@ struct gk20a { struct device *dev; struct platform_device *host1x_dev; + /* + * Used by . Do not access directly! + */ + unsigned long *enabled_flags; + atomic_t usage_count; - int driver_is_dying; atomic_t nonstall_ops; struct work_struct nonstall_fn_work; struct workqueue_struct *nonstall_work_queue; - bool is_fmodel; - struct kref refcount; struct resource *reg_mem; -- cgit v1.2.2