OpenCloudOS-Kernel/drivers/gpu/drm/panfrost/panfrost_features.h

310 lines
11 KiB
C
Raw Normal View History

drm/panfrost: Add initial panfrost driver This adds the initial driver for panfrost which supports Arm Mali Midgard and Bifrost family of GPUs. Currently, only the T860 and T760 Midgard GPUs have been tested. v2: - Add GPU reset on job hangs (Tomeu) - Add RuntimePM and devfreq support (Tomeu) - Fix T760 support (Tomeu) - Add a TODO file (Rob, Tomeu) - Support multiple in fences (Tomeu) - Drop support for shared fences (Tomeu) - Fill in MMU de-init (Rob) - Move register definitions back to single header (Rob) - Clean-up hardcoded job submit todos (Rob) - Implement feature setup based on features/issues (Rob) - Add remaining Midgard DT compatible strings (Rob) v3: - Add support for reset lines (Neil) - Add a MAINTAINERS entry (Rob) - Call dma_set_mask_and_coherent (Rob) - Do MMU invalidate on map and unmap. Restructure to do a single operation per map/unmap call. (Rob) - Add a missing explicit padding to struct drm_panfrost_create_bo (Rob) - Fix 0-day error: "panfrost_devfreq.c:151:9-16: ERROR: PTR_ERR applied after initialization to constant on line 150" - Drop HW_FEATURE_AARCH64_MMU conditional (Rob) - s/DRM_PANFROST_PARAM_GPU_ID/DRM_PANFROST_PARAM_GPU_PROD_ID/ (Rob) - Check drm_gem_shmem_prime_import_sg_table() error code (Rob) - Re-order power on sequence (Rob) - Move panfrost_acquire_object_fences() before scheduling job (Rob) - Add NULL checks on array pointers in job clean-up (Rob) - Rework devfreq (Tomeu) - Fix devfreq init with no regulator (Rob) - Various WS and comments clean-up (Rob) Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <maxime.ripard@bootlin.com> Cc: Sean Paul <sean@poorly.run> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Lyude Paul <lyude@redhat.com> Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Steven Price <steven.price@arm.com> Signed-off-by: Marty E. Plummer <hanetzer@startmail.com> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Rob Herring <robh@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20190409205427.6943-4-robh@kernel.org
2018-09-11 03:27:58 +08:00
/* SPDX-License-Identifier: GPL-2.0 */
/* (C) COPYRIGHT 2014-2018 ARM Limited. All rights reserved. */
/* Copyright 2019 Linaro, Ltd., Rob Herring <robh@kernel.org> */
#ifndef __PANFROST_FEATURES_H__
#define __PANFROST_FEATURES_H__
#include <linux/bitops.h>
#include "panfrost_device.h"
enum panfrost_hw_feature {
HW_FEATURE_JOBCHAIN_DISAMBIGUATION,
HW_FEATURE_PWRON_DURING_PWROFF_TRANS,
HW_FEATURE_XAFFINITY,
HW_FEATURE_OUT_OF_ORDER_EXEC,
HW_FEATURE_MRT,
HW_FEATURE_BRNDOUT_CC,
HW_FEATURE_INTERPIPE_REG_ALIASING,
HW_FEATURE_LD_ST_TILEBUFFER,
HW_FEATURE_MSAA_16X,
HW_FEATURE_32_BIT_UNIFORM_ADDRESS,
HW_FEATURE_ATTR_AUTO_TYPE_INFERRAL,
HW_FEATURE_OPTIMIZED_COVERAGE_MASK,
HW_FEATURE_T7XX_PAIRING_RULES,
HW_FEATURE_LD_ST_LEA_TEX,
HW_FEATURE_LINEAR_FILTER_FLOAT,
HW_FEATURE_WORKGROUP_ROUND_MULTIPLE_OF_4,
HW_FEATURE_IMAGES_IN_FRAGMENT_SHADERS,
HW_FEATURE_TEST4_DATUM_MODE,
HW_FEATURE_NEXT_INSTRUCTION_TYPE,
HW_FEATURE_BRNDOUT_KILL,
HW_FEATURE_WARPING,
HW_FEATURE_V4,
HW_FEATURE_FLUSH_REDUCTION,
HW_FEATURE_PROTECTED_MODE,
HW_FEATURE_COHERENCY_REG,
HW_FEATURE_PROTECTED_DEBUG_MODE,
HW_FEATURE_AARCH64_MMU,
HW_FEATURE_TLS_HASHING,
HW_FEATURE_THREAD_GROUP_SPLIT,
HW_FEATURE_3BIT_EXT_RW_L2_MMU_CONFIG,
};
#define hw_features_t600 (\
BIT_ULL(HW_FEATURE_LD_ST_LEA_TEX) | \
BIT_ULL(HW_FEATURE_LINEAR_FILTER_FLOAT) | \
BIT_ULL(HW_FEATURE_THREAD_GROUP_SPLIT) | \
BIT_ULL(HW_FEATURE_V4))
#define hw_features_t620 (\
BIT_ULL(HW_FEATURE_LD_ST_LEA_TEX) | \
BIT_ULL(HW_FEATURE_LINEAR_FILTER_FLOAT) | \
BIT_ULL(HW_FEATURE_ATTR_AUTO_TYPE_INFERRAL) | \
BIT_ULL(HW_FEATURE_THREAD_GROUP_SPLIT) | \
BIT_ULL(HW_FEATURE_V4))
#define hw_features_t720 (\
BIT_ULL(HW_FEATURE_32_BIT_UNIFORM_ADDRESS) | \
BIT_ULL(HW_FEATURE_ATTR_AUTO_TYPE_INFERRAL) | \
BIT_ULL(HW_FEATURE_INTERPIPE_REG_ALIASING) | \
BIT_ULL(HW_FEATURE_OPTIMIZED_COVERAGE_MASK) | \
BIT_ULL(HW_FEATURE_T7XX_PAIRING_RULES) | \
BIT_ULL(HW_FEATURE_THREAD_GROUP_SPLIT) | \
BIT_ULL(HW_FEATURE_WORKGROUP_ROUND_MULTIPLE_OF_4) | \
BIT_ULL(HW_FEATURE_WARPING) | \
BIT_ULL(HW_FEATURE_V4))
#define hw_features_t760 (\
BIT_ULL(HW_FEATURE_JOBCHAIN_DISAMBIGUATION) | \
BIT_ULL(HW_FEATURE_PWRON_DURING_PWROFF_TRANS) | \
BIT_ULL(HW_FEATURE_XAFFINITY) | \
BIT_ULL(HW_FEATURE_32_BIT_UNIFORM_ADDRESS) | \
BIT_ULL(HW_FEATURE_ATTR_AUTO_TYPE_INFERRAL) | \
BIT_ULL(HW_FEATURE_BRNDOUT_CC) | \
BIT_ULL(HW_FEATURE_LD_ST_LEA_TEX) | \
BIT_ULL(HW_FEATURE_LD_ST_TILEBUFFER) | \
BIT_ULL(HW_FEATURE_LINEAR_FILTER_FLOAT) | \
BIT_ULL(HW_FEATURE_MRT) | \
BIT_ULL(HW_FEATURE_MSAA_16X) | \
BIT_ULL(HW_FEATURE_OUT_OF_ORDER_EXEC) | \
BIT_ULL(HW_FEATURE_T7XX_PAIRING_RULES) | \
BIT_ULL(HW_FEATURE_TEST4_DATUM_MODE) | \
BIT_ULL(HW_FEATURE_THREAD_GROUP_SPLIT))
// T860
#define hw_features_t860 (\
BIT_ULL(HW_FEATURE_JOBCHAIN_DISAMBIGUATION) | \
BIT_ULL(HW_FEATURE_PWRON_DURING_PWROFF_TRANS) | \
BIT_ULL(HW_FEATURE_XAFFINITY) | \
BIT_ULL(HW_FEATURE_32_BIT_UNIFORM_ADDRESS) | \
BIT_ULL(HW_FEATURE_ATTR_AUTO_TYPE_INFERRAL) | \
BIT_ULL(HW_FEATURE_BRNDOUT_CC) | \
BIT_ULL(HW_FEATURE_BRNDOUT_KILL) | \
BIT_ULL(HW_FEATURE_LD_ST_LEA_TEX) | \
BIT_ULL(HW_FEATURE_LD_ST_TILEBUFFER) | \
BIT_ULL(HW_FEATURE_LINEAR_FILTER_FLOAT) | \
BIT_ULL(HW_FEATURE_MRT) | \
BIT_ULL(HW_FEATURE_MSAA_16X) | \
BIT_ULL(HW_FEATURE_NEXT_INSTRUCTION_TYPE) | \
BIT_ULL(HW_FEATURE_OUT_OF_ORDER_EXEC) | \
BIT_ULL(HW_FEATURE_T7XX_PAIRING_RULES) | \
BIT_ULL(HW_FEATURE_TEST4_DATUM_MODE) | \
BIT_ULL(HW_FEATURE_THREAD_GROUP_SPLIT))
#define hw_features_t880 hw_features_t860
#define hw_features_t830 (\
BIT_ULL(HW_FEATURE_JOBCHAIN_DISAMBIGUATION) | \
BIT_ULL(HW_FEATURE_PWRON_DURING_PWROFF_TRANS) | \
BIT_ULL(HW_FEATURE_XAFFINITY) | \
BIT_ULL(HW_FEATURE_WARPING) | \
BIT_ULL(HW_FEATURE_INTERPIPE_REG_ALIASING) | \
BIT_ULL(HW_FEATURE_32_BIT_UNIFORM_ADDRESS) | \
BIT_ULL(HW_FEATURE_ATTR_AUTO_TYPE_INFERRAL) | \
BIT_ULL(HW_FEATURE_BRNDOUT_CC) | \
BIT_ULL(HW_FEATURE_BRNDOUT_KILL) | \
BIT_ULL(HW_FEATURE_LD_ST_LEA_TEX) | \
BIT_ULL(HW_FEATURE_LD_ST_TILEBUFFER) | \
BIT_ULL(HW_FEATURE_LINEAR_FILTER_FLOAT) | \
BIT_ULL(HW_FEATURE_MRT) | \
BIT_ULL(HW_FEATURE_NEXT_INSTRUCTION_TYPE) | \
BIT_ULL(HW_FEATURE_OUT_OF_ORDER_EXEC) | \
BIT_ULL(HW_FEATURE_T7XX_PAIRING_RULES) | \
BIT_ULL(HW_FEATURE_TEST4_DATUM_MODE) | \
BIT_ULL(HW_FEATURE_THREAD_GROUP_SPLIT))
#define hw_features_t820 (\
BIT_ULL(HW_FEATURE_JOBCHAIN_DISAMBIGUATION) | \
BIT_ULL(HW_FEATURE_PWRON_DURING_PWROFF_TRANS) | \
BIT_ULL(HW_FEATURE_XAFFINITY) | \
BIT_ULL(HW_FEATURE_WARPING) | \
BIT_ULL(HW_FEATURE_INTERPIPE_REG_ALIASING) | \
BIT_ULL(HW_FEATURE_32_BIT_UNIFORM_ADDRESS) | \
BIT_ULL(HW_FEATURE_ATTR_AUTO_TYPE_INFERRAL) | \
BIT_ULL(HW_FEATURE_BRNDOUT_CC) | \
BIT_ULL(HW_FEATURE_BRNDOUT_KILL) | \
BIT_ULL(HW_FEATURE_LD_ST_LEA_TEX) | \
BIT_ULL(HW_FEATURE_LD_ST_TILEBUFFER) | \
BIT_ULL(HW_FEATURE_LINEAR_FILTER_FLOAT) | \
BIT_ULL(HW_FEATURE_MRT) | \
BIT_ULL(HW_FEATURE_NEXT_INSTRUCTION_TYPE) | \
BIT_ULL(HW_FEATURE_OUT_OF_ORDER_EXEC) | \
BIT_ULL(HW_FEATURE_T7XX_PAIRING_RULES) | \
BIT_ULL(HW_FEATURE_TEST4_DATUM_MODE) | \
BIT_ULL(HW_FEATURE_THREAD_GROUP_SPLIT))
#define hw_features_g71 (\
BIT_ULL(HW_FEATURE_JOBCHAIN_DISAMBIGUATION) | \
BIT_ULL(HW_FEATURE_PWRON_DURING_PWROFF_TRANS) | \
BIT_ULL(HW_FEATURE_XAFFINITY) | \
BIT_ULL(HW_FEATURE_WARPING) | \
BIT_ULL(HW_FEATURE_INTERPIPE_REG_ALIASING) | \
BIT_ULL(HW_FEATURE_32_BIT_UNIFORM_ADDRESS) | \
BIT_ULL(HW_FEATURE_ATTR_AUTO_TYPE_INFERRAL) | \
BIT_ULL(HW_FEATURE_BRNDOUT_CC) | \
BIT_ULL(HW_FEATURE_BRNDOUT_KILL) | \
BIT_ULL(HW_FEATURE_LD_ST_LEA_TEX) | \
BIT_ULL(HW_FEATURE_LD_ST_TILEBUFFER) | \
BIT_ULL(HW_FEATURE_LINEAR_FILTER_FLOAT) | \
BIT_ULL(HW_FEATURE_MRT) | \
BIT_ULL(HW_FEATURE_MSAA_16X) | \
BIT_ULL(HW_FEATURE_NEXT_INSTRUCTION_TYPE) | \
BIT_ULL(HW_FEATURE_OUT_OF_ORDER_EXEC) | \
BIT_ULL(HW_FEATURE_T7XX_PAIRING_RULES) | \
BIT_ULL(HW_FEATURE_TEST4_DATUM_MODE) | \
BIT_ULL(HW_FEATURE_THREAD_GROUP_SPLIT) | \
BIT_ULL(HW_FEATURE_FLUSH_REDUCTION) | \
BIT_ULL(HW_FEATURE_PROTECTED_MODE) | \
BIT_ULL(HW_FEATURE_COHERENCY_REG))
#define hw_features_g72 (\
BIT_ULL(HW_FEATURE_JOBCHAIN_DISAMBIGUATION) | \
BIT_ULL(HW_FEATURE_PWRON_DURING_PWROFF_TRANS) | \
BIT_ULL(HW_FEATURE_XAFFINITY) | \
BIT_ULL(HW_FEATURE_WARPING) | \
BIT_ULL(HW_FEATURE_INTERPIPE_REG_ALIASING) | \
BIT_ULL(HW_FEATURE_32_BIT_UNIFORM_ADDRESS) | \
BIT_ULL(HW_FEATURE_ATTR_AUTO_TYPE_INFERRAL) | \
BIT_ULL(HW_FEATURE_BRNDOUT_CC) | \
BIT_ULL(HW_FEATURE_BRNDOUT_KILL) | \
BIT_ULL(HW_FEATURE_LD_ST_LEA_TEX) | \
BIT_ULL(HW_FEATURE_LD_ST_TILEBUFFER) | \
BIT_ULL(HW_FEATURE_LINEAR_FILTER_FLOAT) | \
BIT_ULL(HW_FEATURE_MRT) | \
BIT_ULL(HW_FEATURE_MSAA_16X) | \
BIT_ULL(HW_FEATURE_NEXT_INSTRUCTION_TYPE) | \
BIT_ULL(HW_FEATURE_OUT_OF_ORDER_EXEC) | \
BIT_ULL(HW_FEATURE_T7XX_PAIRING_RULES) | \
BIT_ULL(HW_FEATURE_TEST4_DATUM_MODE) | \
BIT_ULL(HW_FEATURE_THREAD_GROUP_SPLIT) | \
BIT_ULL(HW_FEATURE_FLUSH_REDUCTION) | \
BIT_ULL(HW_FEATURE_PROTECTED_MODE) | \
BIT_ULL(HW_FEATURE_PROTECTED_DEBUG_MODE) | \
BIT_ULL(HW_FEATURE_COHERENCY_REG))
#define hw_features_g51 (\
BIT_ULL(HW_FEATURE_JOBCHAIN_DISAMBIGUATION) | \
BIT_ULL(HW_FEATURE_PWRON_DURING_PWROFF_TRANS) | \
BIT_ULL(HW_FEATURE_XAFFINITY) | \
BIT_ULL(HW_FEATURE_WARPING) | \
BIT_ULL(HW_FEATURE_INTERPIPE_REG_ALIASING) | \
BIT_ULL(HW_FEATURE_32_BIT_UNIFORM_ADDRESS) | \
BIT_ULL(HW_FEATURE_ATTR_AUTO_TYPE_INFERRAL) | \
BIT_ULL(HW_FEATURE_BRNDOUT_CC) | \
BIT_ULL(HW_FEATURE_BRNDOUT_KILL) | \
BIT_ULL(HW_FEATURE_LD_ST_LEA_TEX) | \
BIT_ULL(HW_FEATURE_LD_ST_TILEBUFFER) | \
BIT_ULL(HW_FEATURE_LINEAR_FILTER_FLOAT) | \
BIT_ULL(HW_FEATURE_MRT) | \
BIT_ULL(HW_FEATURE_MSAA_16X) | \
BIT_ULL(HW_FEATURE_NEXT_INSTRUCTION_TYPE) | \
BIT_ULL(HW_FEATURE_OUT_OF_ORDER_EXEC) | \
BIT_ULL(HW_FEATURE_T7XX_PAIRING_RULES) | \
BIT_ULL(HW_FEATURE_TEST4_DATUM_MODE) | \
BIT_ULL(HW_FEATURE_THREAD_GROUP_SPLIT) | \
BIT_ULL(HW_FEATURE_FLUSH_REDUCTION) | \
BIT_ULL(HW_FEATURE_PROTECTED_MODE) | \
BIT_ULL(HW_FEATURE_PROTECTED_DEBUG_MODE) | \
BIT_ULL(HW_FEATURE_COHERENCY_REG))
#define hw_features_g52 (\
BIT_ULL(HW_FEATURE_JOBCHAIN_DISAMBIGUATION) | \
BIT_ULL(HW_FEATURE_PWRON_DURING_PWROFF_TRANS) | \
BIT_ULL(HW_FEATURE_XAFFINITY) | \
BIT_ULL(HW_FEATURE_WARPING) | \
BIT_ULL(HW_FEATURE_INTERPIPE_REG_ALIASING) | \
BIT_ULL(HW_FEATURE_32_BIT_UNIFORM_ADDRESS) | \
BIT_ULL(HW_FEATURE_ATTR_AUTO_TYPE_INFERRAL) | \
BIT_ULL(HW_FEATURE_BRNDOUT_CC) | \
BIT_ULL(HW_FEATURE_BRNDOUT_KILL) | \
BIT_ULL(HW_FEATURE_LD_ST_LEA_TEX) | \
BIT_ULL(HW_FEATURE_LD_ST_TILEBUFFER) | \
BIT_ULL(HW_FEATURE_LINEAR_FILTER_FLOAT) | \
BIT_ULL(HW_FEATURE_MRT) | \
BIT_ULL(HW_FEATURE_MSAA_16X) | \
BIT_ULL(HW_FEATURE_NEXT_INSTRUCTION_TYPE) | \
BIT_ULL(HW_FEATURE_OUT_OF_ORDER_EXEC) | \
BIT_ULL(HW_FEATURE_T7XX_PAIRING_RULES) | \
BIT_ULL(HW_FEATURE_TEST4_DATUM_MODE) | \
BIT_ULL(HW_FEATURE_THREAD_GROUP_SPLIT) | \
BIT_ULL(HW_FEATURE_FLUSH_REDUCTION) | \
BIT_ULL(HW_FEATURE_PROTECTED_MODE) | \
BIT_ULL(HW_FEATURE_PROTECTED_DEBUG_MODE) | \
BIT_ULL(HW_FEATURE_COHERENCY_REG))
#define hw_features_g76 (\
BIT_ULL(HW_FEATURE_JOBCHAIN_DISAMBIGUATION) | \
BIT_ULL(HW_FEATURE_PWRON_DURING_PWROFF_TRANS) | \
BIT_ULL(HW_FEATURE_XAFFINITY) | \
BIT_ULL(HW_FEATURE_WARPING) | \
BIT_ULL(HW_FEATURE_INTERPIPE_REG_ALIASING) | \
BIT_ULL(HW_FEATURE_32_BIT_UNIFORM_ADDRESS) | \
BIT_ULL(HW_FEATURE_ATTR_AUTO_TYPE_INFERRAL) | \
BIT_ULL(HW_FEATURE_BRNDOUT_CC) | \
BIT_ULL(HW_FEATURE_BRNDOUT_KILL) | \
BIT_ULL(HW_FEATURE_LD_ST_LEA_TEX) | \
BIT_ULL(HW_FEATURE_LD_ST_TILEBUFFER) | \
BIT_ULL(HW_FEATURE_LINEAR_FILTER_FLOAT) | \
BIT_ULL(HW_FEATURE_MRT) | \
BIT_ULL(HW_FEATURE_MSAA_16X) | \
BIT_ULL(HW_FEATURE_NEXT_INSTRUCTION_TYPE) | \
BIT_ULL(HW_FEATURE_OUT_OF_ORDER_EXEC) | \
BIT_ULL(HW_FEATURE_T7XX_PAIRING_RULES) | \
BIT_ULL(HW_FEATURE_TEST4_DATUM_MODE) | \
BIT_ULL(HW_FEATURE_THREAD_GROUP_SPLIT) | \
BIT_ULL(HW_FEATURE_FLUSH_REDUCTION) | \
BIT_ULL(HW_FEATURE_PROTECTED_MODE) | \
BIT_ULL(HW_FEATURE_PROTECTED_DEBUG_MODE) | \
BIT_ULL(HW_FEATURE_COHERENCY_REG) | \
BIT_ULL(HW_FEATURE_AARCH64_MMU) | \
BIT_ULL(HW_FEATURE_TLS_HASHING) | \
BIT_ULL(HW_FEATURE_3BIT_EXT_RW_L2_MMU_CONFIG))
#define hw_features_g31 (\
BIT_ULL(HW_FEATURE_JOBCHAIN_DISAMBIGUATION) | \
BIT_ULL(HW_FEATURE_PWRON_DURING_PWROFF_TRANS) | \
BIT_ULL(HW_FEATURE_XAFFINITY) | \
BIT_ULL(HW_FEATURE_WARPING) | \
BIT_ULL(HW_FEATURE_INTERPIPE_REG_ALIASING) | \
BIT_ULL(HW_FEATURE_32_BIT_UNIFORM_ADDRESS) | \
BIT_ULL(HW_FEATURE_ATTR_AUTO_TYPE_INFERRAL) | \
BIT_ULL(HW_FEATURE_BRNDOUT_CC) | \
BIT_ULL(HW_FEATURE_BRNDOUT_KILL) | \
BIT_ULL(HW_FEATURE_LD_ST_LEA_TEX) | \
BIT_ULL(HW_FEATURE_LD_ST_TILEBUFFER) | \
BIT_ULL(HW_FEATURE_LINEAR_FILTER_FLOAT) | \
BIT_ULL(HW_FEATURE_MRT) | \
BIT_ULL(HW_FEATURE_MSAA_16X) | \
BIT_ULL(HW_FEATURE_NEXT_INSTRUCTION_TYPE) | \
BIT_ULL(HW_FEATURE_OUT_OF_ORDER_EXEC) | \
BIT_ULL(HW_FEATURE_T7XX_PAIRING_RULES) | \
BIT_ULL(HW_FEATURE_TEST4_DATUM_MODE) | \
BIT_ULL(HW_FEATURE_THREAD_GROUP_SPLIT) | \
BIT_ULL(HW_FEATURE_FLUSH_REDUCTION) | \
BIT_ULL(HW_FEATURE_PROTECTED_MODE) | \
BIT_ULL(HW_FEATURE_PROTECTED_DEBUG_MODE) | \
BIT_ULL(HW_FEATURE_COHERENCY_REG) | \
BIT_ULL(HW_FEATURE_AARCH64_MMU) | \
BIT_ULL(HW_FEATURE_TLS_HASHING) | \
BIT_ULL(HW_FEATURE_3BIT_EXT_RW_L2_MMU_CONFIG))
static inline bool panfrost_has_hw_feature(struct panfrost_device *pfdev,
enum panfrost_hw_feature feat)
{
return test_bit(feat, pfdev->features.hw_features);
}
#endif