Merge tag 'mt76-for-kvalo-2021-01-29' of https://github.com/nbd168/wireless
[linux-2.6-microblaze.git] / drivers / gpu / drm / nouveau / dispnv50 / wndw.c
index ce45124..271de3a 100644 (file)
@@ -702,6 +702,11 @@ nv50_wndw_init(struct nv50_wndw *wndw)
        nvif_notify_get(&wndw->notify);
 }
 
+static const u64 nv50_cursor_format_modifiers[] = {
+       DRM_FORMAT_MOD_LINEAR,
+       DRM_FORMAT_MOD_INVALID,
+};
+
 int
 nv50_wndw_new_(const struct nv50_wndw_func *func, struct drm_device *dev,
               enum drm_plane_type type, const char *name, int index,
@@ -713,6 +718,7 @@ nv50_wndw_new_(const struct nv50_wndw_func *func, struct drm_device *dev,
        struct nvif_mmu *mmu = &drm->client.mmu;
        struct nv50_disp *disp = nv50_disp(dev);
        struct nv50_wndw *wndw;
+       const u64 *format_modifiers;
        int nformat;
        int ret;
 
@@ -728,10 +734,13 @@ nv50_wndw_new_(const struct nv50_wndw_func *func, struct drm_device *dev,
 
        for (nformat = 0; format[nformat]; nformat++);
 
-       ret = drm_universal_plane_init(dev, &wndw->plane, heads, &nv50_wndw,
-                                      format, nformat,
-                                      nouveau_display(dev)->format_modifiers,
-                                      type, "%s-%d", name, index);
+       if (type == DRM_PLANE_TYPE_CURSOR)
+               format_modifiers = nv50_cursor_format_modifiers;
+       else
+               format_modifiers = nouveau_display(dev)->format_modifiers;
+
+       ret = drm_universal_plane_init(dev, &wndw->plane, heads, &nv50_wndw, format, nformat,
+                                      format_modifiers, type, "%s-%d", name, index);
        if (ret) {
                kfree(*pwndw);
                *pwndw = NULL;