pvr: move non-rogue helpers to pvr_hw_utils.h
Reviewed-by: Frank Binns <frank.binns@imgtec.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38352>
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright © 2022 Imagination Technologies Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#ifndef PVR_HW_UTILS_H
|
||||
#define PVR_HW_UTILS_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "util/macros.h"
|
||||
|
||||
#include "pvr_device_info.h"
|
||||
|
||||
static inline uint32_t
|
||||
pvr_get_slc_cache_line_size(const struct pvr_device_info *dev_info)
|
||||
{
|
||||
return PVR_GET_FEATURE_VALUE(dev_info, slc_cache_line_size_bits, 8U) / 8U;
|
||||
}
|
||||
|
||||
static inline uint32_t pvr_get_max_user_vertex_output_components(
|
||||
const struct pvr_device_info *dev_info)
|
||||
{
|
||||
/* Default value based on the minimum value found in all existing cores. */
|
||||
const uint32_t uvs_pba_entries =
|
||||
PVR_GET_FEATURE_VALUE(dev_info, uvs_pba_entries, 160U);
|
||||
|
||||
/* Default value based on the minimum value found in all existing cores. */
|
||||
const uint32_t uvs_banks = PVR_GET_FEATURE_VALUE(dev_info, uvs_banks, 2U);
|
||||
|
||||
if (uvs_banks <= 8U && uvs_pba_entries == 160U) {
|
||||
ASSERTED const uint32_t tpu_parallel_instances =
|
||||
PVR_GET_FEATURE_VALUE(dev_info, tpu_parallel_instances, 1U);
|
||||
|
||||
/* Cores with > 2 ppc support vertex sizes of >= 128 dwords */
|
||||
assert(tpu_parallel_instances <= 2 ||
|
||||
(dev_info->ident.b <= 36 || dev_info->ident.b == 46));
|
||||
|
||||
return 64U;
|
||||
}
|
||||
|
||||
return 128U;
|
||||
}
|
||||
|
||||
#endif /* PVR_HW_UTILS_H */
|
||||
@@ -51,6 +51,8 @@
|
||||
#include "util/compiler.h"
|
||||
#include "util/macros.h"
|
||||
|
||||
#include "pvr_hw_utils.h"
|
||||
|
||||
static inline void
|
||||
rogue_get_isp_samples_per_tile_xy(const struct pvr_device_info *dev_info,
|
||||
uint32_t samples,
|
||||
@@ -258,36 +260,6 @@ rogue_get_render_size_max(const struct pvr_device_info *dev_info)
|
||||
#define rogue_get_render_size_max_y(dev_info) \
|
||||
rogue_get_render_size_max(dev_info)
|
||||
|
||||
static inline uint32_t
|
||||
pvr_get_slc_cache_line_size(const struct pvr_device_info *dev_info)
|
||||
{
|
||||
return PVR_GET_FEATURE_VALUE(dev_info, slc_cache_line_size_bits, 8U) / 8U;
|
||||
}
|
||||
|
||||
static inline uint32_t pvr_get_max_user_vertex_output_components(
|
||||
const struct pvr_device_info *dev_info)
|
||||
{
|
||||
/* Default value based on the minimum value found in all existing cores. */
|
||||
const uint32_t uvs_pba_entries =
|
||||
PVR_GET_FEATURE_VALUE(dev_info, uvs_pba_entries, 160U);
|
||||
|
||||
/* Default value based on the minimum value found in all existing cores. */
|
||||
const uint32_t uvs_banks = PVR_GET_FEATURE_VALUE(dev_info, uvs_banks, 2U);
|
||||
|
||||
if (uvs_banks <= 8U && uvs_pba_entries == 160U) {
|
||||
ASSERTED const uint32_t tpu_parallel_instances =
|
||||
PVR_GET_FEATURE_VALUE(dev_info, tpu_parallel_instances, 1U);
|
||||
|
||||
/* Cores with > 2 ppc support vertex sizes of >= 128 dwords */
|
||||
assert(tpu_parallel_instances <= 2 ||
|
||||
(dev_info->ident.b <= 36 || dev_info->ident.b == 46));
|
||||
|
||||
return 64U;
|
||||
}
|
||||
|
||||
return 128U;
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
rogue_max_compute_shared_registers(const struct pvr_device_info *dev_info)
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include <string.h>
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
#include "hwdef/rogue_hw_utils.h"
|
||||
#include "hwdef/pvr_hw_utils.h"
|
||||
#include "pco_uscgen_programs.h"
|
||||
#include "pvr_bo.h"
|
||||
#include "pvr_border.h"
|
||||
|
||||
Reference in New Issue
Block a user