1bf215546Sopenharmony_ci/*
2bf215546Sopenharmony_ci * Copyright © 2022 Imagination Technologies Ltd.
3bf215546Sopenharmony_ci *
4bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a copy
5bf215546Sopenharmony_ci * of this software and associated documentation files (the "Software"), to deal
6bf215546Sopenharmony_ci * in the Software without restriction, including without limitation the rights
7bf215546Sopenharmony_ci * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8bf215546Sopenharmony_ci * copies of the Software, and to permit persons to whom the Software is
9bf215546Sopenharmony_ci * furnished to do so, subject to the following conditions:
10bf215546Sopenharmony_ci *
11bf215546Sopenharmony_ci * The above copyright notice and this permission notice (including the next
12bf215546Sopenharmony_ci * paragraph) shall be included in all copies or substantial portions of the
13bf215546Sopenharmony_ci * Software.
14bf215546Sopenharmony_ci *
15bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16bf215546Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17bf215546Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18bf215546Sopenharmony_ci * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19bf215546Sopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20bf215546Sopenharmony_ci * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21bf215546Sopenharmony_ci * SOFTWARE.
22bf215546Sopenharmony_ci */
23bf215546Sopenharmony_ci
24bf215546Sopenharmony_ci/* This file is based on rgx_fwif_shared.h and rgx_fwif_client.h. It contains
25bf215546Sopenharmony_ci * information about the firmware that is needed by the driver.
26bf215546Sopenharmony_ci */
27bf215546Sopenharmony_ci
28bf215546Sopenharmony_ci#ifndef PVR_ROGUE_FW_H
29bf215546Sopenharmony_ci#define PVR_ROGUE_FW_H
30bf215546Sopenharmony_ci
31bf215546Sopenharmony_ci/**
32bf215546Sopenharmony_ci * Maximum PB free list size supported by RGX and Services.
33bf215546Sopenharmony_ci *
34bf215546Sopenharmony_ci * Maximum PB free list size must ensure that no PM address space can be fully
35bf215546Sopenharmony_ci * used, because if the full address space was used it would wrap and corrupt
36bf215546Sopenharmony_ci * itself. Since there are two freelists (local is always minimum sized) this
37bf215546Sopenharmony_ci * can be described as following three conditions being met:
38bf215546Sopenharmony_ci *
39bf215546Sopenharmony_ci *  Minimum PB + Maximum PB < ALIST PM address space size (16GB)
40bf215546Sopenharmony_ci *  Minimum PB + Maximum PB < TE PM address space size (16GB) / NUM_TE_PIPES
41bf215546Sopenharmony_ci *  Minimum PB + Maximum PB < VCE PM address space size (16GB) / NUM_VCE_PIPES
42bf215546Sopenharmony_ci *
43bf215546Sopenharmony_ci * Since the max of NUM_TE_PIPES and NUM_VCE_PIPES is 4, we have a hard limit
44bf215546Sopenharmony_ci * of 4GB minus the Minimum PB. For convenience we take the smaller power-of-2
45bf215546Sopenharmony_ci * value of 2GB. This is far more than any normal application would request
46bf215546Sopenharmony_ci * or use.
47bf215546Sopenharmony_ci */
48bf215546Sopenharmony_ci#define ROGUE_FREE_LIST_MAX_SIZE (2ULL * 1024ULL * 1024ULL * 1024ULL)
49bf215546Sopenharmony_ci
50bf215546Sopenharmony_ci/* FIXME: This will change based on the firmware configuration, which will vary
51bf215546Sopenharmony_ci * depending on the BVNC and firmware version. The powervr KM driver allows this
52bf215546Sopenharmony_ci * information to be queried, but the pvrsrvkm KM driver doesn't. This
53bf215546Sopenharmony_ci * information should really be queried from the winsys.
54bf215546Sopenharmony_ci */
55bf215546Sopenharmony_ci/* Indicates the number of Render Target Datas in a Render Target Dataset. */
56bf215546Sopenharmony_ci#define ROGUE_NUM_RTDATAS 2U
57bf215546Sopenharmony_ci
58bf215546Sopenharmony_ci#endif /* PVR_ROGUE_FW_H */
59