nouveau/winsys: Add an info to nouveau_ws_device
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:

committed by
Marge Bot

parent
0d25483101
commit
87f946730f
@@ -84,7 +84,7 @@ mme_tu104_sim_test::SetUp()
|
||||
if (dev == NULL)
|
||||
continue;
|
||||
|
||||
if (dev->cls_eng3d < TURING_A) {
|
||||
if (dev->info.cls_eng3d < TURING_A) {
|
||||
nouveau_ws_device_destroy(dev);
|
||||
dev = NULL;
|
||||
continue;
|
||||
|
@@ -378,7 +378,7 @@ nil_format_supports_texturing(struct nouveau_ws_device *dev,
|
||||
if (desc->layout == UTIL_FORMAT_LAYOUT_ETC ||
|
||||
desc->layout == UTIL_FORMAT_LAYOUT_ASTC) {
|
||||
return dev->device_type == NOUVEAU_WS_DEVICE_TYPE_SOC &&
|
||||
dev->cls_eng3d >= KEPLER_C;
|
||||
dev->info.cls_eng3d >= KEPLER_C;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@@ -368,9 +368,9 @@ nil_choose_pte_kind(struct nouveau_ws_device *dev,
|
||||
enum pipe_format format,
|
||||
uint32_t samples, bool compressed)
|
||||
{
|
||||
if (dev->cls_eng3d >= TURING_A)
|
||||
if (dev->info.cls_eng3d >= TURING_A)
|
||||
return tu102_choose_pte_kind(format, compressed);
|
||||
else if (dev->cls_eng3d >= FERMI_A)
|
||||
else if (dev->info.cls_eng3d >= FERMI_A)
|
||||
return nvc0_choose_pte_kind(format, samples, compressed);
|
||||
else
|
||||
unreachable("Unsupported 3D engine class");
|
||||
|
@@ -499,9 +499,9 @@ nil_image_fill_tic(struct nouveau_ws_device *dev,
|
||||
uint64_t base_address,
|
||||
void *desc_out)
|
||||
{
|
||||
if (dev->cls_eng3d >= MAXWELL_A) {
|
||||
if (dev->info.cls_eng3d >= MAXWELL_A) {
|
||||
nvb097_nil_image_fill_tic(dev, image, view, base_address, desc_out);
|
||||
} else if (dev->cls_eng3d >= FERMI_A) {
|
||||
} else if (dev->info.cls_eng3d >= FERMI_A) {
|
||||
nv9097_nil_image_fill_tic(dev, image, view, base_address, desc_out);
|
||||
} else {
|
||||
unreachable("Tesla and older not supported");
|
||||
@@ -515,9 +515,9 @@ nil_buffer_fill_tic(struct nouveau_ws_device *dev,
|
||||
uint32_t num_elements,
|
||||
void *desc_out)
|
||||
{
|
||||
if (dev->cls_eng3d >= MAXWELL_A) {
|
||||
if (dev->info.cls_eng3d >= MAXWELL_A) {
|
||||
nvb097_nil_buffer_fill_tic(dev, base_address, format, num_elements, desc_out);
|
||||
} else if (dev->cls_eng3d >= FERMI_A) {
|
||||
} else if (dev->info.cls_eng3d >= FERMI_A) {
|
||||
nv9097_nil_buffer_fill_tic(dev, base_address, format, num_elements, desc_out);
|
||||
} else {
|
||||
unreachable("Tesla and older not supported");
|
||||
|
@@ -37,7 +37,7 @@ nvk_get_image_format_features(struct nvk_physical_device *pdevice,
|
||||
|
||||
if (nil_format_supports_filtering(pdevice->dev, p_format)) {
|
||||
features |= VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT;
|
||||
if (pdevice->dev->cls_eng3d >= MAXWELL_B)
|
||||
if (pdevice->info.cls_eng3d >= MAXWELL_B)
|
||||
features |= VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT;
|
||||
}
|
||||
|
||||
|
@@ -531,20 +531,7 @@ nvk_physical_device_try_create(struct nvk_instance *instance,
|
||||
|
||||
device->instance = instance;
|
||||
device->dev = ndev;
|
||||
device->info = (struct nv_device_info) {
|
||||
.pci_domain = drm_device->businfo.pci->domain,
|
||||
.pci_bus = drm_device->businfo.pci->bus,
|
||||
.pci_dev = drm_device->businfo.pci->dev,
|
||||
.pci_func = drm_device->businfo.pci->func,
|
||||
.pci_device_id = drm_device->deviceinfo.pci->device_id,
|
||||
.pci_revision_id = drm_device->deviceinfo.pci->revision_id,
|
||||
|
||||
.cls_copy = ndev->cls_copy,
|
||||
.cls_eng2d = ndev->cls_eng2d,
|
||||
.cls_eng3d = ndev->cls_eng3d,
|
||||
.cls_m2mf = ndev->cls_m2mf,
|
||||
.cls_compute = ndev->cls_compute,
|
||||
};
|
||||
device->info = ndev->info;
|
||||
|
||||
device->mem_heaps[0].flags = VK_MEMORY_HEAP_DEVICE_LOCAL_BIT;
|
||||
device->mem_types[0].propertyFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
|
||||
|
@@ -204,6 +204,15 @@ nouveau_ws_device_new(drmDevicePtr drm_device)
|
||||
if (version < 0x01000301)
|
||||
goto out_err;
|
||||
|
||||
device->info = (struct nv_device_info) {
|
||||
.pci_domain = drm_device->businfo.pci->domain,
|
||||
.pci_bus = drm_device->businfo.pci->bus,
|
||||
.pci_dev = drm_device->businfo.pci->dev,
|
||||
.pci_func = drm_device->businfo.pci->func,
|
||||
.pci_device_id = drm_device->deviceinfo.pci->device_id,
|
||||
.pci_revision_id = drm_device->deviceinfo.pci->revision_id,
|
||||
};
|
||||
|
||||
if (nouveau_ws_device_alloc(fd, device))
|
||||
goto out_err;
|
||||
|
||||
@@ -240,11 +249,11 @@ nouveau_ws_device_new(drmDevicePtr drm_device)
|
||||
if (nouveau_ws_context_create(device, &tmp_ctx))
|
||||
goto out_err;
|
||||
|
||||
device->cls_copy = tmp_ctx->copy.cls;
|
||||
device->cls_eng2d = tmp_ctx->eng2d.cls;
|
||||
device->cls_eng3d = tmp_ctx->eng3d.cls;
|
||||
device->cls_m2mf = tmp_ctx->m2mf.cls;
|
||||
device->cls_compute = tmp_ctx->compute.cls;
|
||||
device->info.cls_copy = tmp_ctx->copy.cls;
|
||||
device->info.cls_eng2d = tmp_ctx->eng2d.cls;
|
||||
device->info.cls_eng3d = tmp_ctx->eng3d.cls;
|
||||
device->info.cls_m2mf = tmp_ctx->m2mf.cls;
|
||||
device->info.cls_compute = tmp_ctx->compute.cls;
|
||||
|
||||
nouveau_ws_context_destroy(tmp_ctx);
|
||||
|
||||
|
@@ -2,6 +2,7 @@
|
||||
#define NOUVEAU_DEVICE 1
|
||||
|
||||
#include "nouveau_private.h"
|
||||
#include "nv_device_info.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
@@ -41,11 +42,7 @@ struct nouveau_ws_device {
|
||||
enum nouveau_ws_device_type device_type;
|
||||
uint32_t chipset;
|
||||
|
||||
uint16_t cls_copy;
|
||||
uint16_t cls_eng2d;
|
||||
uint16_t cls_eng3d;
|
||||
uint16_t cls_m2mf;
|
||||
uint16_t cls_compute;
|
||||
struct nv_device_info info;
|
||||
|
||||
char *chipset_name;
|
||||
char *device_name;
|
||||
|
Reference in New Issue
Block a user