wndw.c (4b4193256c8d3bc3a5397b5cd9494c2ad386317d) wndw.c (8ef23b6f6a79e6fa2a169081d2d76011fffa0482)
1/*
2 * Copyright 2018 Red Hat Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the

--- 528 unchanged lines hidden (view full) ---

537 struct nv50_wndw_ctxdma *ctxdma;
538 int ret;
539
540 NV_ATOMIC(drm, "%s prepare: %p\n", plane->name, fb);
541 if (!asyw->state.fb)
542 return 0;
543
544 nvbo = nouveau_gem_object(fb->obj[0]);
1/*
2 * Copyright 2018 Red Hat Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the

--- 528 unchanged lines hidden (view full) ---

537 struct nv50_wndw_ctxdma *ctxdma;
538 int ret;
539
540 NV_ATOMIC(drm, "%s prepare: %p\n", plane->name, fb);
541 if (!asyw->state.fb)
542 return 0;
543
544 nvbo = nouveau_gem_object(fb->obj[0]);
545 ret = nouveau_bo_pin(nvbo, TTM_PL_FLAG_VRAM, true);
545 ret = nouveau_bo_pin(nvbo, NOUVEAU_GEM_DOMAIN_VRAM, true);
546 if (ret)
547 return ret;
548
549 if (wndw->ctxdma.parent) {
550 ctxdma = nv50_wndw_ctxdma_new(wndw, fb);
551 if (IS_ERR(ctxdma)) {
552 nouveau_bo_unpin(nvbo);
553 return PTR_ERR(ctxdma);

--- 225 unchanged lines hidden (view full) ---

779 struct nv50_wndw **pwndw)
780{
781 struct {
782 s32 oclass;
783 int version;
784 int (*new)(struct nouveau_drm *, enum drm_plane_type,
785 int, s32, struct nv50_wndw **);
786 } wndws[] = {
546 if (ret)
547 return ret;
548
549 if (wndw->ctxdma.parent) {
550 ctxdma = nv50_wndw_ctxdma_new(wndw, fb);
551 if (IS_ERR(ctxdma)) {
552 nouveau_bo_unpin(nvbo);
553 return PTR_ERR(ctxdma);

--- 225 unchanged lines hidden (view full) ---

779 struct nv50_wndw **pwndw)
780{
781 struct {
782 s32 oclass;
783 int version;
784 int (*new)(struct nouveau_drm *, enum drm_plane_type,
785 int, s32, struct nv50_wndw **);
786 } wndws[] = {
787 { GA102_DISP_WINDOW_CHANNEL_DMA, 0, wndwc67e_new },
787 { TU102_DISP_WINDOW_CHANNEL_DMA, 0, wndwc57e_new },
788 { GV100_DISP_WINDOW_CHANNEL_DMA, 0, wndwc37e_new },
789 {}
790 };
791 struct nv50_disp *disp = nv50_disp(drm->dev);
792 int cid, ret;
793
794 cid = nvif_mclass(&disp->disp->object, wndws);
795 if (cid < 0) {
796 NV_ERROR(drm, "No supported window class\n");
797 return cid;
798 }
799
800 ret = wndws[cid].new(drm, type, index, wndws[cid].oclass, pwndw);
801 if (ret)
802 return ret;
803
804 return nv50_wimm_init(drm, *pwndw);
805}
788 { TU102_DISP_WINDOW_CHANNEL_DMA, 0, wndwc57e_new },
789 { GV100_DISP_WINDOW_CHANNEL_DMA, 0, wndwc37e_new },
790 {}
791 };
792 struct nv50_disp *disp = nv50_disp(drm->dev);
793 int cid, ret;
794
795 cid = nvif_mclass(&disp->disp->object, wndws);
796 if (cid < 0) {
797 NV_ERROR(drm, "No supported window class\n");
798 return cid;
799 }
800
801 ret = wndws[cid].new(drm, type, index, wndws[cid].oclass, pwndw);
802 if (ret)
803 return ret;
804
805 return nv50_wimm_init(drm, *pwndw);
806}