wndw.c (82ffd0454bd9bd57780966d47bfd56d579dd4fb3) wndw.c (8603774233507550d557272146ba1834071e3e49)
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

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

621 struct nv50_wndw **pwndw)
622{
623 struct {
624 s32 oclass;
625 int version;
626 int (*new)(struct nouveau_drm *, enum drm_plane_type,
627 int, s32, struct nv50_wndw **);
628 } wndws[] = {
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

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

621 struct nv50_wndw **pwndw)
622{
623 struct {
624 s32 oclass;
625 int version;
626 int (*new)(struct nouveau_drm *, enum drm_plane_type,
627 int, s32, struct nv50_wndw **);
628 } wndws[] = {
629 { TU104_DISP_WINDOW_CHANNEL_DMA, 0, wndwc57e_new },
629 { TU102_DISP_WINDOW_CHANNEL_DMA, 0, wndwc57e_new },
630 { GV100_DISP_WINDOW_CHANNEL_DMA, 0, wndwc37e_new },
631 {}
632 };
633 struct nv50_disp *disp = nv50_disp(drm->dev);
634 int cid, ret;
635
636 cid = nvif_mclass(&disp->disp->object, wndws);
637 if (cid < 0) {
638 NV_ERROR(drm, "No supported window class\n");
639 return cid;
640 }
641
642 ret = wndws[cid].new(drm, type, index, wndws[cid].oclass, pwndw);
643 if (ret)
644 return ret;
645
646 return nv50_wimm_init(drm, *pwndw);
647}
630 { GV100_DISP_WINDOW_CHANNEL_DMA, 0, wndwc37e_new },
631 {}
632 };
633 struct nv50_disp *disp = nv50_disp(drm->dev);
634 int cid, ret;
635
636 cid = nvif_mclass(&disp->disp->object, wndws);
637 if (cid < 0) {
638 NV_ERROR(drm, "No supported window class\n");
639 return cid;
640 }
641
642 ret = wndws[cid].new(drm, type, index, wndws[cid].oclass, pwndw);
643 if (ret)
644 return ret;
645
646 return nv50_wimm_init(drm, *pwndw);
647}