| 1 | /************************************************************************** |
| 2 | |
| 3 | Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. |
| 4 | All Rights Reserved. |
| 5 | |
| 6 | Permission is hereby granted, free of charge, to any person obtaining a |
| 7 | copy of this software and associated documentation files (the |
| 8 | "Software"), to deal in the Software without restriction, including |
| 9 | without limitation the rights to use, copy, modify, merge, publish, |
| 10 | distribute, sub license, and/or sell copies of the Software, and to |
| 11 | permit persons to whom the Software is furnished to do so, subject to |
| 12 | the following conditions: |
| 13 | |
| 14 | The above copyright notice and this permission notice (including the |
| 15 | next paragraph) shall be included in all copies or substantial portions |
| 16 | of the Software. |
| 17 | |
| 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 19 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. |
| 21 | IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR |
| 22 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 23 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 24 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 25 | |
| 26 | **************************************************************************/ |
| 27 | |
| 28 | #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:410:9`! |
| 29 | #include "config.h"cxx . . $ `<file>/config.h`/ |
| 30 | #endif |
| 31 | |
| 32 | /* |
| 33 | * Authors: |
| 34 | * Keith Whitwell <[email protected]> |
| 35 | * |
| 36 | */ |
| 37 | |
| 38 | #include "xorg-server.h" |
| 39 | #include "xf86.h" |
| 40 | #include "xf86_OSproc.h" |
| 41 | |
| 42 | #include "i810.h"cxx . . $ `<file>/src/legacy/i810/i810.h`/ |
| 43 | #include "i810_reg.h"cxx . . $ `<file>/src/legacy/i810/i810_reg.h`/ |
| 44 | |
| 45 | int |
| 46 | I810AllocLowcxx . . $ I810AllocLow(ae4240c8130f9653).(I810MemRangecxx . . $ I810MemRange# * result, I810MemRangecxx . . $ I810MemRange# * pool, int size) |
| 47 | { |
| 48 | if (size > (long)pool->Sizecxx . . $ $anonymous_type_548a72e1bd8fd39a_0#Size.) |
| 49 | return 0; |
| 50 | |
| 51 | pool->Sizecxx . . $ $anonymous_type_548a72e1bd8fd39a_0#Size. -= size; |
| 52 | result->Sizecxx . . $ $anonymous_type_548a72e1bd8fd39a_0#Size. = size; |
| 53 | result->Startcxx . . $ $anonymous_type_548a72e1bd8fd39a_0#Start. = pool->Startcxx . . $ $anonymous_type_548a72e1bd8fd39a_0#Start.; |
| 54 | result->Endcxx . . $ $anonymous_type_548a72e1bd8fd39a_0#End. = pool->Startcxx . . $ $anonymous_type_548a72e1bd8fd39a_0#Start. += size; |
| 55 | |
| 56 | return 1; |
| 57 | } |
| 58 | |
| 59 | int |
| 60 | I810AllocHighcxx . . $ I810AllocHigh(ae4240c8130f9653).(I810MemRangecxx . . $ I810MemRange# * result, I810MemRangecxx . . $ I810MemRange# * pool, int size) |
| 61 | { |
| 62 | if (size > (long)pool->Sizecxx . . $ $anonymous_type_548a72e1bd8fd39a_0#Size.) |
| 63 | return 0; |
| 64 | |
| 65 | pool->Sizecxx . . $ $anonymous_type_548a72e1bd8fd39a_0#Size. -= size; |
| 66 | result->Sizecxx . . $ $anonymous_type_548a72e1bd8fd39a_0#Size. = size; |
| 67 | result->Endcxx . . $ $anonymous_type_548a72e1bd8fd39a_0#End. = pool->Endcxx . . $ $anonymous_type_548a72e1bd8fd39a_0#End.; |
| 68 | result->Startcxx . . $ $anonymous_type_548a72e1bd8fd39a_0#Start. = pool->Endcxx . . $ $anonymous_type_548a72e1bd8fd39a_0#End. -= size; |
| 69 | |
| 70 | return 1; |
| 71 | } |
| 72 | |
| 73 | int |
| 74 | I810AllocateGARTMemorycxx . . $ I810AllocateGARTMemory(69e744c47d5d770d).(ScrnInfoPtrcxx . . $ ScrnInfoPtr# pScrn) |
| 75 | { |
| 76 | unsigned long size = pScrn->videoRamcxx . . $ _ScrnInfoRec#videoRam. * 1024UL; |
| 77 | I810Ptrcxx . . $ I810Ptr# pI810 = I810PTRcxx . . $ `src/legacy/i810/i810.h:265:9`!(pScrn); |
| 78 | int key; |
| 79 | unsigned long tom = 0; |
| 80 | unsigned long physical; |
| 81 | |
| 82 | if (!xf86AgpGARTSupportedcxx . . $ xf86AgpGARTSupported(b126dc7c1de90089).() || !xf86AcquireGARTcxx . . $ xf86AcquireGART(7864480464b09eea).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex.)) { |
| 83 | xf86DrvMsgcxx . . $ xf86DrvMsg(68e14d797711febb).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., X_ERRORcxx . . $ X_ERROR., |
| 84 | "AGP GART support is either not available or cannot be used.\n" |
| 85 | "\tMake sure your kernel has agpgart support or has the\n" |
| 86 | "\tagpgart module loaded.\n"); |
| 87 | return FALSEcxx . . $ `<external>/18388808314464358495/misc.h:108:9`!; |
| 88 | } |
| 89 | |
| 90 | /* This allows the 2d only Xserver to regen */ |
| 91 | pI810->agpAcquired2dcxx . . $ _I810Rec#agpAcquired2d. = TRUEcxx . . $ `<external>/18388808314464358495/misc.h:107:9`!; |
| 92 | |
| 93 | /* |
| 94 | * I810/I815 |
| 95 | * |
| 96 | * Treat the gart like video memory - we assume we own all that is |
| 97 | * there, so ignore EBUSY errors. Don't try to remove it on |
| 98 | * failure, either, as other X server may be using it. |
| 99 | */ |
| 100 | |
| 101 | if ((key = xf86AllocateGARTMemorycxx . . $ xf86AllocateGARTMemory(436482d82eacd3ed).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., size, 0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)) == -1) |
| 102 | return FALSEcxx . . $ `<external>/18388808314464358495/misc.h:108:9`!; |
| 103 | |
| 104 | pI810->VramOffsetcxx . . $ _I810Rec#VramOffset. = 0; |
| 105 | pI810->VramKeycxx . . $ _I810Rec#VramKey. = key; |
| 106 | |
| 107 | if (!xf86BindGARTMemorycxx . . $ xf86BindGARTMemory(54be06d4503f0606).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., key, 0)) |
| 108 | return FALSEcxx . . $ `<external>/18388808314464358495/misc.h:108:9`!; |
| 109 | |
| 110 | pI810->SysMemcxx . . $ _I810Rec#SysMem..Startcxx . . $ $anonymous_type_548a72e1bd8fd39a_0#Start. = 0; |
| 111 | pI810->SysMemcxx . . $ _I810Rec#SysMem..Sizecxx . . $ $anonymous_type_548a72e1bd8fd39a_0#Size. = size; |
| 112 | pI810->SysMemcxx . . $ _I810Rec#SysMem..Endcxx . . $ $anonymous_type_548a72e1bd8fd39a_0#End. = size; |
| 113 | pI810->SavedSysMemcxx . . $ _I810Rec#SavedSysMem. = pI810->SysMemcxx . . $ _I810Rec#SysMem.; |
| 114 | |
| 115 | tom = pI810->SysMemcxx . . $ _I810Rec#SysMem..Endcxx . . $ $anonymous_type_548a72e1bd8fd39a_0#End.; |
| 116 | |
| 117 | pI810->DcacheMemcxx . . $ _I810Rec#DcacheMem..Startcxx . . $ $anonymous_type_548a72e1bd8fd39a_0#Start. = 0; |
| 118 | pI810->DcacheMemcxx . . $ _I810Rec#DcacheMem..Endcxx . . $ $anonymous_type_548a72e1bd8fd39a_0#End. = 0; |
| 119 | pI810->DcacheMemcxx . . $ _I810Rec#DcacheMem..Sizecxx . . $ $anonymous_type_548a72e1bd8fd39a_0#Size. = 0; |
| 120 | pI810->CursorPhysicalcxx . . $ _I810Rec#CursorPhysical. = 0; |
| 121 | pI810->CursorARGBPhysicalcxx . . $ _I810Rec#CursorARGBPhysical. = 0; |
| 122 | |
| 123 | /* |
| 124 | * Dcache - half the speed of normal ram, so not really useful for |
| 125 | * a 2d server. Don't bother reporting its presence. This is |
| 126 | * mapped in addition to the requested amount of system ram. |
| 127 | */ |
| 128 | |
| 129 | size = 1024 * 4096; |
| 130 | |
| 131 | /* |
| 132 | * Keep it 512K aligned for the sake of tiled regions. |
| 133 | */ |
| 134 | |
| 135 | tom += 0x7ffffUL; |
| 136 | tom &= ~0x7ffffUL; |
| 137 | |
| 138 | if ((key = xf86AllocateGARTMemorycxx . . $ xf86AllocateGARTMemory(436482d82eacd3ed).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., size, 1, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)) != -1) { |
| 139 | pI810->DcacheOffsetcxx . . $ _I810Rec#DcacheOffset. = tom; |
| 140 | pI810->DcacheKeycxx . . $ _I810Rec#DcacheKey. = key; |
| 141 | if (!xf86BindGARTMemorycxx . . $ xf86BindGARTMemory(54be06d4503f0606).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., key, tom)) { |
| 142 | xf86DrvMsgcxx . . $ xf86DrvMsg(68e14d797711febb).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., X_INFOcxx . . $ X_INFO., |
| 143 | "Allocation of %ld bytes for DCACHE failed\n", size); |
| 144 | pI810->DcacheKeycxx . . $ _I810Rec#DcacheKey. = -1; |
| 145 | } else { |
| 146 | pI810->DcacheMemcxx . . $ _I810Rec#DcacheMem..Startcxx . . $ $anonymous_type_548a72e1bd8fd39a_0#Start. = tom; |
| 147 | pI810->DcacheMemcxx . . $ _I810Rec#DcacheMem..Sizecxx . . $ $anonymous_type_548a72e1bd8fd39a_0#Size. = size; |
| 148 | pI810->DcacheMemcxx . . $ _I810Rec#DcacheMem..Endcxx . . $ $anonymous_type_548a72e1bd8fd39a_0#End. = pI810->DcacheMemcxx . . $ _I810Rec#DcacheMem..Startcxx . . $ $anonymous_type_548a72e1bd8fd39a_0#Start. + pI810->DcacheMemcxx . . $ _I810Rec#DcacheMem..Sizecxx . . $ $anonymous_type_548a72e1bd8fd39a_0#Size.; |
| 149 | tom = pI810->DcacheMemcxx . . $ _I810Rec#DcacheMem..Endcxx . . $ $anonymous_type_548a72e1bd8fd39a_0#End.; |
| 150 | } |
| 151 | } else { |
| 152 | xf86DrvMsgcxx . . $ xf86DrvMsg(68e14d797711febb).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., X_INFOcxx . . $ X_INFO., |
| 153 | "No physical memory available for %ld bytes of DCACHE\n", |
| 154 | size); |
| 155 | pI810->DcacheKeycxx . . $ _I810Rec#DcacheKey. = -1; |
| 156 | } |
| 157 | |
| 158 | /* |
| 159 | * Mouse cursor -- The i810 (crazy) needs a physical address in |
| 160 | * system memory from which to upload the cursor. We get this from |
| 161 | * the agpgart module using a special memory type. |
| 162 | */ |
| 163 | |
| 164 | /* |
| 165 | * 4k for the cursor is excessive, I'm going to steal 3k for |
| 166 | * overlay registers later |
| 167 | */ |
| 168 | |
| 169 | size = 4096; |
| 170 | |
| 171 | if ((key = |
| 172 | xf86AllocateGARTMemorycxx . . $ xf86AllocateGARTMemory(436482d82eacd3ed).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., size, 2, &physical)) == -1) { |
| 173 | xf86DrvMsgcxx . . $ xf86DrvMsg(68e14d797711febb).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., X_INFOcxx . . $ X_INFO., |
| 174 | "No physical memory available for HW cursor\n"); |
| 175 | pI810->HwcursKeycxx . . $ _I810Rec#HwcursKey. = -1; |
| 176 | pI810->CursorStartcxx . . $ _I810Rec#CursorStart. = 0; |
| 177 | } else { |
| 178 | pI810->HwcursOffsetcxx . . $ _I810Rec#HwcursOffset. = tom; |
| 179 | pI810->HwcursKeycxx . . $ _I810Rec#HwcursKey. = key; |
| 180 | if (!xf86BindGARTMemorycxx . . $ xf86BindGARTMemory(54be06d4503f0606).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., key, tom)) { |
| 181 | xf86DrvMsgcxx . . $ xf86DrvMsg(68e14d797711febb).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., X_INFOcxx . . $ X_INFO., |
| 182 | "Allocation of %ld bytes for HW cursor failed\n", size); |
| 183 | pI810->HwcursKeycxx . . $ _I810Rec#HwcursKey. = -1; |
| 184 | } else { |
| 185 | xf86DrvMsgcxx . . $ xf86DrvMsg(68e14d797711febb).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., X_INFOcxx . . $ X_INFO., |
| 186 | "Allocated of %ld bytes for HW cursor\n", size); |
| 187 | pI810->CursorPhysicalcxx . . $ _I810Rec#CursorPhysical. = physical; |
| 188 | pI810->CursorStartcxx . . $ _I810Rec#CursorStart. = tom; |
| 189 | tom += size; |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | /* |
| 194 | * 16k for the ARGB cursor |
| 195 | */ |
| 196 | |
| 197 | size = 16384; |
| 198 | |
| 199 | if ((key = |
| 200 | xf86AllocateGARTMemorycxx . . $ xf86AllocateGARTMemory(436482d82eacd3ed).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., size, 2, &physical)) == -1) { |
| 201 | xf86DrvMsgcxx . . $ xf86DrvMsg(68e14d797711febb).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., X_INFOcxx . . $ X_INFO., |
| 202 | "No physical memory available for ARGB HW cursor\n"); |
| 203 | pI810->ARGBHwcursKeycxx . . $ _I810Rec#ARGBHwcursKey. = -1; |
| 204 | pI810->CursorARGBStartcxx . . $ _I810Rec#CursorARGBStart. = 0; |
| 205 | } else { |
| 206 | pI810->ARGBHwcursOffsetcxx . . $ _I810Rec#ARGBHwcursOffset. = tom; |
| 207 | pI810->ARGBHwcursKeycxx . . $ _I810Rec#ARGBHwcursKey. = key; |
| 208 | if (!xf86BindGARTMemorycxx . . $ xf86BindGARTMemory(54be06d4503f0606).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., key, tom)) { |
| 209 | xf86DrvMsgcxx . . $ xf86DrvMsg(68e14d797711febb).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., X_INFOcxx . . $ X_INFO., |
| 210 | "Allocation of %ld bytes for ARGB HW cursor failed\n", size); |
| 211 | pI810->ARGBHwcursKeycxx . . $ _I810Rec#ARGBHwcursKey. = -1; |
| 212 | } else { |
| 213 | xf86DrvMsgcxx . . $ xf86DrvMsg(68e14d797711febb).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., X_INFOcxx . . $ X_INFO., |
| 214 | "Allocated of %ld bytes for ARGB HW cursor\n", size); |
| 215 | pI810->CursorARGBPhysicalcxx . . $ _I810Rec#CursorARGBPhysical. = physical; |
| 216 | pI810->CursorARGBStartcxx . . $ _I810Rec#CursorARGBStart. = tom; |
| 217 | tom += size; |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | /* |
| 222 | * Overlay register buffer -- Just like the cursor, the i810 needs a |
| 223 | * physical address in system memory from which to upload the overlay |
| 224 | * registers. |
| 225 | */ |
| 226 | |
| 227 | if (pI810->CursorStartcxx . . $ _I810Rec#CursorStart. != 0) { |
| 228 | pI810->OverlayPhysicalcxx . . $ _I810Rec#OverlayPhysical. = pI810->CursorPhysicalcxx . . $ _I810Rec#CursorPhysical. + 1024; |
| 229 | pI810->OverlayStartcxx . . $ _I810Rec#OverlayStart. = pI810->CursorStartcxx . . $ _I810Rec#CursorStart. + 1024; |
| 230 | } |
| 231 | |
| 232 | pI810->GttBoundcxx . . $ _I810Rec#GttBound. = 1; |
| 233 | |
| 234 | return TRUEcxx . . $ `<external>/18388808314464358495/misc.h:107:9`!; |
| 235 | } |
| 236 | |
| 237 | /* Tiled memory is good... really, really good... |
| 238 | * |
| 239 | * Need to make it less likely that we miss out on this - probably |
| 240 | * need to move the frontbuffer away from the 'guarenteed' alignment |
| 241 | * of the first memory segment, or perhaps allocate a discontigous |
| 242 | * framebuffer to get more alignment 'sweet spots'. |
| 243 | */ |
| 244 | void |
| 245 | I810SetTiledMemorycxx . . $ I810SetTiledMemory(66a90c276f0762eb).(ScrnInfoPtrcxx . . $ ScrnInfoPtr# pScrn, int nr, unsigned int start, |
| 246 | unsigned int pitch, unsigned int size) |
| 247 | { |
| 248 | I810Ptrcxx . . $ I810Ptr# pI810 = I810PTRcxx . . $ `src/legacy/i810/i810.h:265:9`!(pScrn); |
| 249 | I810RegPtrcxx . . $ I810RegPtr# i810Reg = &pI810->ModeRegcxx . . $ _I810Rec#ModeReg.; |
| 250 | uint32_tcxx . . $ uint32_t# val; |
| 251 | uint32_tcxx . . $ uint32_t# fence_mask = 0; |
| 252 | |
| 253 | if (nr < 0 || nr > 7) { |
| 254 | xf86DrvMsgcxx . . $ xf86DrvMsg(68e14d797711febb).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., X_WARNINGcxx . . $ X_WARNING., "%s - fence %d out of range\n", |
| 255 | "I810SetTiledMemory", nr); |
| 256 | return; |
| 257 | } |
| 258 | |
| 259 | i810Reg->Fencecxx . . $ $anonymous_type_548a72e1bd8fd39a_2#Fence.[nr] = 0; |
| 260 | |
| 261 | fence_mask = ~FENCE_START_MASKcxx . . $ `src/legacy/i810/i810_reg.h:570:9`!; |
| 262 | |
| 263 | if (start & fence_mask) { |
| 264 | xf86DrvMsgcxx . . $ xf86DrvMsg(68e14d797711febb).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., X_WARNINGcxx . . $ X_WARNING., |
| 265 | "%s %d: start (%x) is not 512k aligned\n", |
| 266 | "I810SetTiledMemory", nr, start); |
| 267 | return; |
| 268 | } |
| 269 | |
| 270 | if (start % size) { |
| 271 | xf86DrvMsgcxx . . $ xf86DrvMsg(68e14d797711febb).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., X_WARNINGcxx . . $ X_WARNING., |
| 272 | "%s %d: start (%x) is not size (%x) aligned\n", |
| 273 | "I810SetTiledMemory", nr, start, size); |
| 274 | return; |
| 275 | } |
| 276 | |
| 277 | if (pitch & 127) { |
| 278 | xf86DrvMsgcxx . . $ xf86DrvMsg(68e14d797711febb).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., X_WARNINGcxx . . $ X_WARNING., |
| 279 | "%s %d: pitch (%x) not a multiple of 128 bytes\n", |
| 280 | "I810SetTiledMemory", nr, pitch); |
| 281 | return; |
| 282 | } |
| 283 | |
| 284 | val = (start | FENCE_X_MAJORcxx . . $ `src/legacy/i810/i810_reg.h:571:9`! | FENCE_VALIDcxx . . $ `src/legacy/i810/i810_reg.h:599:9`!); |
| 285 | |
| 286 | switch (size) { |
| 287 | case KBcxx . . $ `src/legacy/i810/i810_common.h:50:9`!(512): |
| 288 | val |= FENCE_SIZE_512Kcxx . . $ `src/legacy/i810/i810_reg.h:574:9`!; |
| 289 | break; |
| 290 | case MBcxx . . $ `src/legacy/i810/i810_common.h:51:9`!(1): |
| 291 | val |= FENCE_SIZE_1Mcxx . . $ `src/legacy/i810/i810_reg.h:575:9`!; |
| 292 | break; |
| 293 | case MBcxx . . $ `src/legacy/i810/i810_common.h:51:9`!(2): |
| 294 | val |= FENCE_SIZE_2Mcxx . . $ `src/legacy/i810/i810_reg.h:576:9`!; |
| 295 | break; |
| 296 | case MBcxx . . $ `src/legacy/i810/i810_common.h:51:9`!(4): |
| 297 | val |= FENCE_SIZE_4Mcxx . . $ `src/legacy/i810/i810_reg.h:577:9`!; |
| 298 | break; |
| 299 | case MBcxx . . $ `src/legacy/i810/i810_common.h:51:9`!(8): |
| 300 | val |= FENCE_SIZE_8Mcxx . . $ `src/legacy/i810/i810_reg.h:578:9`!; |
| 301 | break; |
| 302 | case MBcxx . . $ `src/legacy/i810/i810_common.h:51:9`!(16): |
| 303 | val |= FENCE_SIZE_16Mcxx . . $ `src/legacy/i810/i810_reg.h:579:9`!; |
| 304 | break; |
| 305 | case MBcxx . . $ `src/legacy/i810/i810_common.h:51:9`!(32): |
| 306 | val |= FENCE_SIZE_32Mcxx . . $ `src/legacy/i810/i810_reg.h:580:9`!; |
| 307 | break; |
| 308 | default: |
| 309 | xf86DrvMsgcxx . . $ xf86DrvMsg(68e14d797711febb).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., X_WARNINGcxx . . $ X_WARNING., |
| 310 | "%s %d: illegal size (0x%x)\n", "I810SetTiledMemory", nr, |
| 311 | size); |
| 312 | return; |
| 313 | } |
| 314 | |
| 315 | switch (pitch / 128) { |
| 316 | case 1: |
| 317 | val |= FENCE_PITCH_1cxx . . $ `src/legacy/i810/i810_reg.h:592:9`!; |
| 318 | break; |
| 319 | case 2: |
| 320 | val |= FENCE_PITCH_2cxx . . $ `src/legacy/i810/i810_reg.h:593:9`!; |
| 321 | break; |
| 322 | case 4: |
| 323 | val |= FENCE_PITCH_4cxx . . $ `src/legacy/i810/i810_reg.h:594:9`!; |
| 324 | break; |
| 325 | case 8: |
| 326 | val |= FENCE_PITCH_8cxx . . $ `src/legacy/i810/i810_reg.h:595:9`!; |
| 327 | break; |
| 328 | case 16: |
| 329 | val |= FENCE_PITCH_16cxx . . $ `src/legacy/i810/i810_reg.h:596:9`!; |
| 330 | break; |
| 331 | case 32: |
| 332 | val |= FENCE_PITCH_32cxx . . $ `src/legacy/i810/i810_reg.h:597:9`!; |
| 333 | break; |
| 334 | default: |
| 335 | xf86DrvMsgcxx . . $ xf86DrvMsg(68e14d797711febb).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., X_WARNINGcxx . . $ X_WARNING., |
| 336 | "%s %d: illegal size (0x%x)\n", "I810SetTiledMemory", nr, |
| 337 | size); |
| 338 | return; |
| 339 | } |
| 340 | |
| 341 | i810Reg->Fencecxx . . $ $anonymous_type_548a72e1bd8fd39a_2#Fence.[nr] = val; |
| 342 | } |
| 343 | |
| 344 | Boolcxx . . $ Bool# |
| 345 | I810BindGARTMemorycxx . . $ I810BindGARTMemory(69e744c47d5d770d).(ScrnInfoPtrcxx . . $ ScrnInfoPtr# pScrn) |
| 346 | { |
| 347 | I810Ptrcxx . . $ I810Ptr# pI810 = I810PTRcxx . . $ `src/legacy/i810/i810.h:265:9`!(pScrn); |
| 348 | |
| 349 | if (xf86AgpGARTSupportedcxx . . $ xf86AgpGARTSupported(b126dc7c1de90089).() && !pI810->directRenderingEnabledcxx . . $ _I810Rec#directRenderingEnabled. |
| 350 | && !pI810->GttBoundcxx . . $ _I810Rec#GttBound.) { |
| 351 | if (!xf86AcquireGARTcxx . . $ xf86AcquireGART(7864480464b09eea).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex.)) |
| 352 | return FALSEcxx . . $ `<external>/18388808314464358495/misc.h:108:9`!; |
| 353 | |
| 354 | if (pI810->VramKeycxx . . $ _I810Rec#VramKey. != -1 |
| 355 | && !xf86BindGARTMemorycxx . . $ xf86BindGARTMemory(54be06d4503f0606).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., pI810->VramKeycxx . . $ _I810Rec#VramKey., |
| 356 | pI810->VramOffsetcxx . . $ _I810Rec#VramOffset.)) |
| 357 | return FALSEcxx . . $ `<external>/18388808314464358495/misc.h:108:9`!; |
| 358 | |
| 359 | if (pI810->DcacheKeycxx . . $ _I810Rec#DcacheKey. != -1 |
| 360 | && !xf86BindGARTMemorycxx . . $ xf86BindGARTMemory(54be06d4503f0606).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., pI810->DcacheKeycxx . . $ _I810Rec#DcacheKey., |
| 361 | pI810->DcacheOffsetcxx . . $ _I810Rec#DcacheOffset.)) |
| 362 | return FALSEcxx . . $ `<external>/18388808314464358495/misc.h:108:9`!; |
| 363 | |
| 364 | if (pI810->HwcursKeycxx . . $ _I810Rec#HwcursKey. != -1 |
| 365 | && !xf86BindGARTMemorycxx . . $ xf86BindGARTMemory(54be06d4503f0606).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., pI810->HwcursKeycxx . . $ _I810Rec#HwcursKey., |
| 366 | pI810->HwcursOffsetcxx . . $ _I810Rec#HwcursOffset.)) |
| 367 | return FALSEcxx . . $ `<external>/18388808314464358495/misc.h:108:9`!; |
| 368 | |
| 369 | if (pI810->ARGBHwcursKeycxx . . $ _I810Rec#ARGBHwcursKey. != -1 |
| 370 | && !xf86BindGARTMemorycxx . . $ xf86BindGARTMemory(54be06d4503f0606).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., pI810->ARGBHwcursKeycxx . . $ _I810Rec#ARGBHwcursKey., |
| 371 | pI810->ARGBHwcursOffsetcxx . . $ _I810Rec#ARGBHwcursOffset.)) |
| 372 | return FALSEcxx . . $ `<external>/18388808314464358495/misc.h:108:9`!; |
| 373 | |
| 374 | pI810->GttBoundcxx . . $ _I810Rec#GttBound. = 1; |
| 375 | } |
| 376 | |
| 377 | return TRUEcxx . . $ `<external>/18388808314464358495/misc.h:107:9`!; |
| 378 | } |
| 379 | |
| 380 | Boolcxx . . $ Bool# |
| 381 | I810UnbindGARTMemorycxx . . $ I810UnbindGARTMemory(69e744c47d5d770d).(ScrnInfoPtrcxx . . $ ScrnInfoPtr# pScrn) |
| 382 | { |
| 383 | I810Ptrcxx . . $ I810Ptr# pI810 = I810PTRcxx . . $ `src/legacy/i810/i810.h:265:9`!(pScrn); |
| 384 | |
| 385 | if (xf86AgpGARTSupportedcxx . . $ xf86AgpGARTSupported(b126dc7c1de90089).() && !pI810->directRenderingEnabledcxx . . $ _I810Rec#directRenderingEnabled. |
| 386 | && pI810->GttBoundcxx . . $ _I810Rec#GttBound.) { |
| 387 | if (pI810->VramKeycxx . . $ _I810Rec#VramKey. != -1 |
| 388 | && !xf86UnbindGARTMemorycxx . . $ xf86UnbindGARTMemory(9b79fb6aee4c0440).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., pI810->VramKeycxx . . $ _I810Rec#VramKey.)) |
| 389 | return FALSEcxx . . $ `<external>/18388808314464358495/misc.h:108:9`!; |
| 390 | |
| 391 | if (pI810->DcacheKeycxx . . $ _I810Rec#DcacheKey. != -1 |
| 392 | && !xf86UnbindGARTMemorycxx . . $ xf86UnbindGARTMemory(9b79fb6aee4c0440).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., pI810->DcacheKeycxx . . $ _I810Rec#DcacheKey.)) |
| 393 | return FALSEcxx . . $ `<external>/18388808314464358495/misc.h:108:9`!; |
| 394 | |
| 395 | if (pI810->HwcursKeycxx . . $ _I810Rec#HwcursKey. != -1 |
| 396 | && !xf86UnbindGARTMemorycxx . . $ xf86UnbindGARTMemory(9b79fb6aee4c0440).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., pI810->HwcursKeycxx . . $ _I810Rec#HwcursKey.)) |
| 397 | return FALSEcxx . . $ `<external>/18388808314464358495/misc.h:108:9`!; |
| 398 | |
| 399 | if (pI810->ARGBHwcursKeycxx . . $ _I810Rec#ARGBHwcursKey. != -1 |
| 400 | && !xf86UnbindGARTMemorycxx . . $ xf86UnbindGARTMemory(9b79fb6aee4c0440).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., pI810->ARGBHwcursKeycxx . . $ _I810Rec#ARGBHwcursKey.)) |
| 401 | return FALSEcxx . . $ `<external>/18388808314464358495/misc.h:108:9`!; |
| 402 | |
| 403 | if (!xf86ReleaseGARTcxx . . $ xf86ReleaseGART(7864480464b09eea).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex.)) |
| 404 | return FALSEcxx . . $ `<external>/18388808314464358495/misc.h:108:9`!; |
| 405 | |
| 406 | pI810->GttBoundcxx . . $ _I810Rec#GttBound. = 0; |
| 407 | } |
| 408 | |
| 409 | return TRUEcxx . . $ `<external>/18388808314464358495/misc.h:107:9`!; |
| 410 | } |
| 411 | |
| 412 | int |
| 413 | I810CheckAvailableMemorycxx . . $ I810CheckAvailableMemory(69e744c47d5d770d).(ScrnInfoPtrcxx . . $ ScrnInfoPtr# pScrn) |
| 414 | { |
| 415 | AgpInfoPtrcxx . . $ AgpInfoPtr# agpinf; |
| 416 | int maxPages; |
| 417 | |
| 418 | if (!xf86AgpGARTSupportedcxx . . $ xf86AgpGARTSupported(b126dc7c1de90089).() || |
| 419 | !xf86AcquireGARTcxx . . $ xf86AcquireGART(7864480464b09eea).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex.) || |
| 420 | (agpinf = xf86GetAGPInfocxx . . $ xf86GetAGPInfo(a0e42c7ee558875c).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex.)) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || |
| 421 | !xf86ReleaseGARTcxx . . $ xf86ReleaseGART(7864480464b09eea).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex.)) |
| 422 | return -1; |
| 423 | |
| 424 | maxPages = agpinf->totalPagescxx . . $ _AgpInfo#totalPages. - agpinf->usedPagescxx . . $ _AgpInfo#usedPages.; |
| 425 | xf86DrvMsgVerbcxx . . $ xf86DrvMsgVerb(6b7e39cd61e125d1).(pScrn->scrnIndexcxx . . $ _ScrnInfoRec#scrnIndex., X_INFOcxx . . $ X_INFO., 2, "%s: %dk available\n", |
| 426 | "I810CheckAvailableMemory", maxPages * 4); |
| 427 | |
| 428 | return maxPages * 4; |
| 429 | } |