panfrost: Add preliminary support for Mali G72

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6885>
This commit is contained in:
Boris Brezillon
2020-09-23 11:08:02 +02:00
committed by Marge Bot
parent c420db1665
commit fefb3e9b70
7 changed files with 12 additions and 0 deletions

View File

@@ -326,6 +326,8 @@ panfrost_emit_blend(struct panfrost_batch *batch, void *rts,
brts[i].constant = blend[i].equation.constant;
brts[i].format = panfrost_format_to_bifrost_blend(format_desc);
if (dev->quirks & HAS_SWIZZLES)
brts[i].swizzle = panfrost_get_default_swizzle(4);
/* 0x19 disables blending and forces REPLACE
* mode (equivalent to rgb_mode = alpha_mode =

View File

@@ -1021,6 +1021,7 @@ panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so,
so->bo = panfrost_bo_create(device, size, 0);
panfrost_new_texture_bifrost(
device,
&so->bifrost_descriptor,
texture->width0, texture->height0,
depth, array_size,

View File

@@ -714,6 +714,7 @@ panfrost_create_screen(int fd, struct renderonly *ro)
case 0x820: /* T820 */
case 0x860: /* T860 */
break;
case 0x6221: /* G72 */
case 0x7093: /* G31 */
case 0x7212: /* G52 */
if (dev->debug & PAN_DBG_BIFROST)

View File

@@ -105,6 +105,7 @@ panfrost_get_quirks(unsigned gpu_id)
return MIDGARD_QUIRKS;
case 0x6000: /* G71 */
case 0x6221: /* G72 */
return BIFROST_QUIRKS | HAS_SWIZZLES;
case 0x7093: /* G31 */

View File

@@ -146,6 +146,7 @@ panfrost_model_name(unsigned gpu_id)
case 0x750: return "Mali T760 (Panfrost)";
case 0x860: return "Mali T860 (Panfrost)";
case 0x880: return "Mali T880 (Panfrost)";
case 0x6221: return "Mali G72 (Panfrost)";
case 0x7093: return "Mali G31 (Panfrost)";
case 0x7212: return "Mali G52 (Panfrost)";
default:

View File

@@ -28,6 +28,7 @@
#include "util/macros.h"
#include "util/u_math.h"
#include "pan_texture.h"
#include "panfrost-quirks.h"
/* Generates a texture descriptor. Ideally, descriptors are immutable after the
* texture is created, so we can keep these hanging around in GPU memory in a
@@ -352,6 +353,7 @@ panfrost_new_texture(
void
panfrost_new_texture_bifrost(
const struct panfrost_device *dev,
struct mali_bifrost_texture_packed *out,
uint16_t width, uint16_t height,
uint16_t depth, uint16_t array_size,
@@ -393,6 +395,9 @@ panfrost_new_texture_bifrost(
pan_pack(out, BIFROST_TEXTURE, cfg) {
cfg.dimension = dim;
cfg.format = (mali_format << 12) | (srgb << 20);
if (dev->quirks & HAS_SWIZZLES)
cfg.format |= panfrost_get_default_swizzle(desc->nr_channels);
cfg.width = u_minify(width, first_level);
cfg.height = u_minify(height, first_level);
cfg.swizzle = swizzle;

View File

@@ -113,6 +113,7 @@ panfrost_new_texture(
void
panfrost_new_texture_bifrost(
const struct panfrost_device *dev,
struct mali_bifrost_texture_packed *out,
uint16_t width, uint16_t height,
uint16_t depth, uint16_t array_size,