0540a7c2935729a4eb701caab95bf979c0046ed1
2 * Copyright (c) 2015 Intel Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
26 #include "gen_device_info.h"
29 * Chunk of L3 cache reserved for some specific purpose.
31 enum gen_l3_partition
{
32 /** Shared local memory. */
34 /** Unified return buffer. */
36 /** Union of DC and RO. */
38 /** Data cluster RW partition. */
40 /** Union of IS, C and T. */
42 /** Instruction and state cache. */
44 /** Constant cache. */
48 /** Number of supported L3 partitions. */
53 * L3 configuration represented as the number of ways allocated for each
54 * partition. \sa get_l3_way_size().
56 struct gen_l3_config
{
57 unsigned n
[GEN_NUM_L3P
];
61 * L3 configuration represented as a vector of weights giving the desired
62 * relative size of each partition. The scale is arbitrary, only the ratios
63 * between weights will have an influence on the selection of the closest L3
66 struct gen_l3_weights
{
70 float gen_diff_l3_weights(struct gen_l3_weights w0
, struct gen_l3_weights w1
);
73 gen_get_default_l3_weights(const struct gen_device_info
*devinfo
,
74 bool needs_dc
, bool needs_slm
);
77 gen_get_l3_config_weights(const struct gen_l3_config
*cfg
);
79 const struct gen_l3_config
*
80 gen_get_default_l3_config(const struct gen_device_info
*devinfo
);
82 const struct gen_l3_config
*
83 gen_get_l3_config(const struct gen_device_info
*devinfo
,
84 struct gen_l3_weights w0
);
87 gen_get_l3_config_urb_size(const struct gen_device_info
*devinfo
,
88 const struct gen_l3_config
*cfg
);
90 void gen_dump_l3_config(const struct gen_l3_config
*cfg
, FILE *fp
);