mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 18:16:01 +03:00
Currently, the kind map initialization inherits from earlier chips' kind map definitions and simply adds on newly supported features. This is dangerous as changes in older architectures may affect newer architectures in unpredictable ways. This patch removes inheritance between subsequent architectures' kind map initializations. Jira NVGPU-74 Change-Id: Ie5c33f613db7ba109564b4cb2312e47ee3332afc Signed-off-by: Sunny He <suhe@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1537745 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
86 lines
2.3 KiB
C
86 lines
2.3 KiB
C
/*
|
|
* drivers/video/tegra/host/gk20a/kind_gk20a.h
|
|
*
|
|
* GK20A memory kind management
|
|
*
|
|
* Copyright (c) 2011-2017, NVIDIA CORPORATION. All rights reserved.
|
|
*
|
|
* 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.
|
|
*
|
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
* more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along with
|
|
* this program; if not, write to the Free Software Foundation, Inc.,
|
|
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
|
*/
|
|
#ifndef __KIND_GK20A_H__
|
|
#define __KIND_GK20A_H__
|
|
|
|
#include <nvgpu/bitops.h>
|
|
|
|
void gk20a_init_uncompressed_kind_map(void);
|
|
void gk20a_init_kind_attr(void);
|
|
|
|
extern u16 gk20a_kind_attr[];
|
|
#define NV_KIND_ATTR_SIZE 256
|
|
#define NV_KIND_DEFAULT -1
|
|
|
|
#define GK20A_KIND_ATTR_SUPPORTED BIT(0)
|
|
#define GK20A_KIND_ATTR_COMPRESSIBLE BIT(1)
|
|
#define GK20A_KIND_ATTR_Z BIT(2)
|
|
#define GK20A_KIND_ATTR_C BIT(3)
|
|
#define GK20A_KIND_ATTR_ZBC BIT(4)
|
|
|
|
/* TBD: not sure on the work creation for gk20a, doubtful */
|
|
static inline bool gk20a_kind_work_creation_sked(u8 k)
|
|
{
|
|
return false;
|
|
}
|
|
static inline bool gk20a_kind_work_creation_host(u8 k)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
static inline bool gk20a_kind_work_creation(u8 k)
|
|
{
|
|
return gk20a_kind_work_creation_sked(k) ||
|
|
gk20a_kind_work_creation_host(k);
|
|
}
|
|
|
|
static inline bool gk20a_kind_is_supported(u8 k)
|
|
{
|
|
return !!(gk20a_kind_attr[k] & GK20A_KIND_ATTR_SUPPORTED);
|
|
}
|
|
static inline bool gk20a_kind_is_compressible(u8 k)
|
|
{
|
|
return !!(gk20a_kind_attr[k] & GK20A_KIND_ATTR_COMPRESSIBLE);
|
|
}
|
|
|
|
static inline bool gk20a_kind_is_z(u8 k)
|
|
{
|
|
return !!(gk20a_kind_attr[k] & GK20A_KIND_ATTR_Z);
|
|
}
|
|
|
|
static inline bool gk20a_kind_is_c(u8 k)
|
|
{
|
|
return !!(gk20a_kind_attr[k] & GK20A_KIND_ATTR_C);
|
|
}
|
|
static inline bool gk20a_kind_is_zbc(u8 k)
|
|
{
|
|
return !!(gk20a_kind_attr[k] & GK20A_KIND_ATTR_ZBC);
|
|
}
|
|
|
|
/* maps kind to its uncompressed version */
|
|
extern u8 gk20a_uc_kind_map[];
|
|
static inline u8 gk20a_get_uncompressed_kind(u8 k)
|
|
{
|
|
return gk20a_uc_kind_map[k];
|
|
}
|
|
|
|
#endif /* __KIND_GK20A_H__ */
|