nouveau/winsys: Move device type into nv_device_info

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Faith Ekstrand 2023-01-30 20:12:05 -06:00 committed by Marge Bot
parent 87f946730f
commit 433e742682
4 changed files with 12 additions and 11 deletions

View file

@ -377,7 +377,7 @@ nil_format_supports_texturing(struct nouveau_ws_device *dev,
const struct util_format_description *desc = util_format_description(format);
if (desc->layout == UTIL_FORMAT_LAYOUT_ETC ||
desc->layout == UTIL_FORMAT_LAYOUT_ASTC) {
return dev->device_type == NOUVEAU_WS_DEVICE_TYPE_SOC &&
return dev->info.type == NV_DEVICE_TYPE_SOC &&
dev->info.cls_eng3d >= KEPLER_C;
}

View file

@ -1,6 +1,12 @@
#ifndef NV_DEVINFO_H
#define NV_DEVINFO_H
enum nv_device_type {
NV_DEVICE_TYPE_IGP,
NV_DEVICE_TYPE_DIS,
NV_DEVICE_TYPE_SOC,
};
struct nv_device_info {
uint16_t pci_domain;
uint8_t pci_bus;
@ -9,6 +15,8 @@ struct nv_device_info {
uint16_t pci_device_id;
uint8_t pci_revision_id;
enum nv_device_type type;
uint16_t cls_copy;
uint16_t cls_eng2d;
uint16_t cls_eng3d;

View file

@ -161,16 +161,16 @@ nouveau_ws_device_info(int fd, struct nouveau_ws_device *dev)
switch (args.info.platform) {
case NV_DEVICE_INFO_V0_IGP:
dev->device_type = NOUVEAU_WS_DEVICE_TYPE_IGP;
dev->info.type = NV_DEVICE_TYPE_IGP;
break;
case NV_DEVICE_INFO_V0_SOC:
dev->device_type = NOUVEAU_WS_DEVICE_TYPE_SOC;
dev->info.type = NV_DEVICE_TYPE_SOC;
break;
case NV_DEVICE_INFO_V0_PCI:
case NV_DEVICE_INFO_V0_AGP:
case NV_DEVICE_INFO_V0_PCIE:
default:
dev->device_type = NOUVEAU_WS_DEVICE_TYPE_DIS;
dev->info.type = NV_DEVICE_TYPE_DIS;
break;
}

View file

@ -28,18 +28,11 @@ enum nvk_debug {
NVK_DEBUG_ZERO_MEMORY = 1ull << 2,
};
enum nouveau_ws_device_type {
NOUVEAU_WS_DEVICE_TYPE_IGP = 0,
NOUVEAU_WS_DEVICE_TYPE_DIS = 1,
NOUVEAU_WS_DEVICE_TYPE_SOC = 2,
};
struct nouveau_ws_device {
int fd;
uint16_t vendor_id;
uint16_t device_id;
enum nouveau_ws_device_type device_type;
uint32_t chipset;
struct nv_device_info info;