OSDN Git Service

gralloc_drm_pipe: add support for winsys handle types
[android-x86/external-drm_gralloc.git] / gralloc_drm_nouveau.c
index b93c564..f3ecfd6 100644 (file)
@@ -47,6 +47,7 @@
 #define NV_FERMI    0xc0
 #define NV_KEPLER   0xe0
 #define NV_MAXWELL  0x110
+#define NV_PASCAL   0x130
 
 #define NV50_TILE_HEIGHT(m) (4 << ((m) >> 4))
 #define NVC0_TILE_HEIGHT(m) (8 << ((m) >> 4))
@@ -55,7 +56,7 @@
 // Comment out the following to switch between the "sw_indicator disables all
 // tiling" and "sw_indicator zeroes the tile|surf_flags (object tiling?)".
 // Does the latter even make sense ... ? Going through the kernel on the
-// topic is slightly annoying :\
+// topic is slightly annoying :/
 
 #undef SW_INDICATOR_FULLY_DISABLES_TILING
 
@@ -302,12 +303,12 @@ static void nouveau_init_kms_features(struct gralloc_drm_drv_t *drv,
 {
        struct nouveau_info *info = (struct nouveau_info *) drv;
 
-       switch (drm->primary.fb_format) {
+       switch (drm->primary->fb_format) {
        case HAL_PIXEL_FORMAT_BGRA_8888:
        case HAL_PIXEL_FORMAT_RGB_565:
                break;
        default:
-               drm->primary.fb_format = HAL_PIXEL_FORMAT_BGRA_8888;
+               drm->primary->fb_format = HAL_PIXEL_FORMAT_BGRA_8888;
                break;
        }
 
@@ -362,11 +363,16 @@ static int nouveau_init(struct nouveau_info *info)
                break;
        case 0xe0:
        case 0xf0:
+       case 0x100:
                info->arch = NV_KEPLER;
                break;
        case 0x110:
+       case 0x120:
                info->arch = NV_MAXWELL;
                break;
+       case 0x130:
+               info->arch = NV_PASCAL;
+               break;
        default:
                ALOGE("unknown nouveau chipset 0x%x", info->dev->chipset);
                err = -EINVAL;