ovly507e.c (9d6c2fe1917fc5ba6a9e8586ca16d007410baf42) | ovly507e.c (53e0a3e70de69dc9f498d26c6b5495b2771ee374) |
---|---|
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 --- 20 unchanged lines hidden (view full) --- 29ovly507e = { 30}; 31 32static const u32 33ovly507e_format[] = { 34 0 35}; 36 | 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 --- 20 unchanged lines hidden (view full) --- 29ovly507e = { 30}; 31 32static const u32 33ovly507e_format[] = { 34 0 35}; 36 |
37static int | 37int |
38ovly507e_new_(const struct nv50_wndw_func *func, const u32 *format, | 38ovly507e_new_(const struct nv50_wndw_func *func, const u32 *format, |
39 struct nouveau_drm *drm, int head, s32 oclass, | 39 struct nouveau_drm *drm, int head, s32 oclass, u32 interlock_data, |
40 struct nv50_wndw **pwndw) 41{ 42 struct nv50_disp_overlay_channel_dma_v0 args = { 43 .head = head, 44 }; 45 struct nv50_disp *disp = nv50_disp(drm->dev); 46 struct nv50_wndw *wndw; 47 int ret; 48 49 ret = nv50_wndw_new_(func, drm->dev, DRM_PLANE_TYPE_OVERLAY, | 40 struct nv50_wndw **pwndw) 41{ 42 struct nv50_disp_overlay_channel_dma_v0 args = { 43 .head = head, 44 }; 45 struct nv50_disp *disp = nv50_disp(drm->dev); 46 struct nv50_wndw *wndw; 47 int ret; 48 49 ret = nv50_wndw_new_(func, drm->dev, DRM_PLANE_TYPE_OVERLAY, |
50 "ovly", head, format, BIT(head), &wndw); | 50 "ovly", head, format, BIT(head), 51 NV50_DISP_INTERLOCK_OVLY, interlock_data, 52 &wndw); |
51 if (*pwndw = wndw, ret) 52 return ret; 53 54 ret = nv50_dmac_create(&drm->client.device, &disp->disp->object, 55 &oclass, 0, &args, sizeof(args), 56 disp->sync->bo.offset, &wndw->wndw); 57 if (ret) { 58 NV_ERROR(drm, "ovly%04x allocation failed: %d\n", oclass, ret); 59 return ret; 60 } 61 62 return 0; 63} 64 65int 66ovly507e_new(struct nouveau_drm *drm, int head, s32 oclass, 67 struct nv50_wndw **pwndw) 68{ | 53 if (*pwndw = wndw, ret) 54 return ret; 55 56 ret = nv50_dmac_create(&drm->client.device, &disp->disp->object, 57 &oclass, 0, &args, sizeof(args), 58 disp->sync->bo.offset, &wndw->wndw); 59 if (ret) { 60 NV_ERROR(drm, "ovly%04x allocation failed: %d\n", oclass, ret); 61 return ret; 62 } 63 64 return 0; 65} 66 67int 68ovly507e_new(struct nouveau_drm *drm, int head, s32 oclass, 69 struct nv50_wndw **pwndw) 70{ |
69 return ovly507e_new_(&ovly507e, ovly507e_format, drm, head, oclass, pwndw); | 71 return ovly507e_new_(&ovly507e, ovly507e_format, drm, head, oclass, 72 0x00000004 << (head * 8), pwndw); |
70} | 73} |