Rev 1731 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1731 | Rev 1750 | ||
---|---|---|---|
Line 261... | Line 261... | ||
261 | ; set resolution [width]*[height] |
261 | ; set resolution [width]*[height] |
262 | SetMode: |
262 | SetMode: |
263 | ; 1. Program the registers of videocard. |
263 | ; 1. Program the registers of videocard. |
264 | ; look into the PRM |
264 | ; look into the PRM |
265 | cli |
265 | cli |
266 | or byte [esi+7000Ah], 0Ch ; PIPEACONF: disable Display+Cursor Planes |
266 | ; or byte [esi+7000Ah], 0Ch ; PIPEACONF: disable Display+Cursor Planes |
267 | or byte [esi+7100Ah], 0Ch ; PIPEBCONF: disable Display+Cursor Planes |
267 | ; or byte [esi+7100Ah], 0Ch ; PIPEBCONF: disable Display+Cursor Planes |
- | 268 | xor eax, eax |
|
- | 269 | xor edx, edx |
|
- | 270 | cmp [deviceType], i965_start |
|
- | 271 | jb @f |
|
- | 272 | mov dl, 9Ch - 84h |
|
- | 273 | @@: |
|
- | 274 | ; or byte [esi+71403h], 80h ; VGACNTRL: VGA Display Disable |
|
- | 275 | and byte [esi+70080h], not 27h ; CURACNTR: disable cursor A |
|
- | 276 | mov dword [esi+70084h], eax ; CURABASE: force write to CURA* regs |
|
- | 277 | and byte [esi+700C0h], not 27h ; CURBCNTR: disable cursor B |
|
- | 278 | mov dword [esi+700C4h], eax ; CURBBASE: force write to CURB* regs |
|
- | 279 | and byte [esi+70183h], not 80h ; DSPACNTR: disable Primary A Plane |
|
- | 280 | mov dword [esi+edx+70184h], eax ; DSPALINOFF/DSPASURF: force write to DSPA* regs |
|
- | 281 | and byte [esi+71183h], not 80h ; DSPBCNTR: disable Primary B Plane |
|
- | 282 | mov dword [esi+edx+71184h], eax ; DSPBLINOFF/DSPBSURF: force write to DSPB* regs |
|
- | 283 | if 1 |
|
- | 284 | cmp [deviceType], ironlake_start |
|
- | 285 | jae .disable_pipes |
|
- | 286 | mov edx, 10000h |
|
- | 287 | or byte [esi+70024h], 2 ; PIPEASTAT: clear VBLANK status |
|
- | 288 | or byte [esi+71024h], 2 ; PIPEBSTAT: clear VBLANK status |
|
- | 289 | .wait_vblank_preironlake1: |
|
- | 290 | mov ecx, 1000h |
|
- | 291 | loop $ |
|
- | 292 | test byte [esi+7000Bh], 80h ; PIPEACONF: pipe A active? |
|
- | 293 | jz @f |
|
- | 294 | test byte [esi+70024h], 2 ; PIPEASTAT: got VBLANK? |
|
- | 295 | jz .wait_vblank_preironlake2 |
|
- | 296 | @@: |
|
- | 297 | test byte [esi+7100Bh], 80h ; PIPEBCONF: pipe B active? |
|
- | 298 | jz .disable_pipes |
|
- | 299 | test byte [esi+71024h], 2 ; PIPEBSTAT: got VBLANK? |
|
- | 300 | jnz .disable_pipes |
|
- | 301 | .wait_vblank_preironlake2: |
|
- | 302 | dec edx |
|
- | 303 | jnz .wait_vblank_preironlake1 |
|
- | 304 | jmp .not_disabled |
|
- | 305 | .disable_pipes: |
|
- | 306 | end if |
|
268 | and byte [esi+7000Bh], not 80h ; PIPEACONF: disable pipe |
307 | and byte [esi+7000Bh], not 80h ; PIPEACONF: disable pipe |
269 | and byte [esi+7100Bh], not 80h ; PIPEBCONF: disable pipe |
308 | and byte [esi+7100Bh], not 80h ; PIPEBCONF: disable pipe |
270 | ; or byte [esi+71403h], 80h ; VGACNTRL: VGA Display Disable |
- | |
- | 309 | if 1 |
|
271 | mov edx, 10000h |
310 | mov edx, 10000h |
272 | @@: |
311 | @@: |
273 | mov ecx, 1000h |
312 | mov ecx, 1000h |
274 | loop $ |
313 | loop $ |
275 | test byte [esi+7000Bh], 40h ; PIPEACONF: wait until pipe disabled |
314 | test byte [esi+7000Bh], 40h ; PIPEACONF: wait until pipe disabled |
Line 286... | Line 325... | ||
286 | loop $ |
325 | loop $ |
287 | dec edx |
326 | dec edx |
288 | jnz @b |
327 | jnz @b |
289 | jmp .not_disabled |
328 | jmp .not_disabled |
290 | @@: |
329 | @@: |
- | 330 | else |
|
- | 331 | ; alternative way of waiting for pipe stop, works too |
|
- | 332 | mov edx, 1000h |
|
- | 333 | .dis1: |
|
- | 334 | push dword [esi+71000h] |
|
- | 335 | push dword [esi+70000h] |
|
- | 336 | mov ecx, 10000h |
|
- | 337 | loop $ |
|
- | 338 | pop eax |
|
- | 339 | xor eax, [esi+70000h] |
|
- | 340 | and eax, 1FFFh |
|
- | 341 | pop eax |
|
- | 342 | jnz .notdis1 |
|
- | 343 | xor eax, [esi+71000h] |
|
- | 344 | and eax, 1FFFh |
|
- | 345 | jz .disabled |
|
- | 346 | .notdis1: |
|
- | 347 | dec edx |
|
- | 348 | jnz .dis1 |
|
- | 349 | .not_disabled: |
|
- | 350 | sti |
|
- | 351 | jmp .return |
|
- | 352 | .disabled: |
|
- | 353 | end if |
|
291 | lea eax, [esi+61183h] |
354 | lea eax, [esi+61183h] |
292 | cmp [deviceType], ironlake_start |
355 | cmp [deviceType], ironlake_start |
293 | jb @f |
356 | jb @f |
294 | add eax, 0xE0000 - 0x60000 |
357 | add eax, 0xE0000 - 0x60000 |
295 | @@: |
358 | @@: |
Line 310... | Line 373... | ||
310 | add ecx, 15 |
373 | add ecx, 15 |
311 | and ecx, not 15 |
374 | and ecx, not 15 |
312 | shl ecx, 2 |
375 | shl ecx, 2 |
313 | mov dword [edx+10188h], ecx ; DSPASTRIDE: set scanline length |
376 | mov dword [edx+10188h], ecx ; DSPASTRIDE: set scanline length |
314 | and byte [esi+61233h], not 80h ; PFIT_CONTROL: disable panel fitting |
377 | and byte [esi+61233h], not 80h ; PFIT_CONTROL: disable panel fitting |
315 | or byte [edx+10183h], 80h ; DSPACNTR: enable Display Plane A |
- | |
316 | or byte [edx+1000Bh], 80h ; PIPEACONF: enable pipe |
378 | or byte [edx+1000Bh], 80h ; PIPEACONF: enable pipe |
317 | and byte [edx+1000Ah], not 0Ch ; PIPEACONF: enable Display+Cursor Planes |
379 | ; and byte [edx+1000Ah], not 0Ch ; PIPEACONF: enable Display+Cursor Planes |
- | 380 | or byte [edx+10183h], 80h ; DSPACNTR: enable Display Plane A |
|
318 | sti |
381 | sti |
319 | ; 2. Notify the kernel that resolution has changed. |
382 | ; 2. Notify the kernel that resolution has changed. |
320 | call GetDisplay |
383 | call GetDisplay |
321 | mov edx, [width] |
384 | mov edx, [width] |
322 | mov dword [eax+8], edx |
385 | mov dword [eax+8], edx |
Line 354... | Line 417... | ||
354 | dw 0x258a ; i915g |
417 | dw 0x258a ; i915g |
355 | dw 0x2592 ; i915gm |
418 | dw 0x2592 ; i915gm |
356 | dw 0x2772 ; i945g |
419 | dw 0x2772 ; i945g |
357 | dw 0x27a2 ; i945gm |
420 | dw 0x27a2 ; i945gm |
358 | dw 0x27ae ; i945gm |
421 | dw 0x27ae ; i945gm |
- | 422 | i965_start = ($ - pciids) / 2 |
|
359 | dw 0x2972 ; i965g |
423 | dw 0x2972 ; i965g |
360 | dw 0x2982 ; i965g |
424 | dw 0x2982 ; i965g |
361 | dw 0x2992 ; i965g |
425 | dw 0x2992 ; i965g |
362 | dw 0x29a2 ; i965g |
426 | dw 0x29a2 ; i965g |
363 | dw 0x29b2 ; g33 |
427 | dw 0x29b2 ; g33 |