kms: pre rc7

git-svn-id: svn://kolibrios.org@1275 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2009-11-16 11:28:19 +00:00
parent e586c535b0
commit b81d03be4e
13 changed files with 120 additions and 88 deletions

View File

@ -640,12 +640,6 @@ struct fb_ops {
/* perform fb specific mmap */
// int (*fb_mmap)(struct fb_info *info, struct vm_area_struct *vma);
/* save current hardware state */
void (*fb_save_state)(struct fb_info *info);
/* restore saved state */
void (*fb_restore_state)(struct fb_info *info);
/* get capability given var */
void (*fb_get_caps)(struct fb_info *info, struct fb_blit_caps *caps,
struct fb_var_screeninfo *var);

View File

@ -213,8 +213,6 @@ bool radeon_card_posted(struct radeon_device *rdev)
{
uint32_t reg;
ENTER();
/* first check CRTCs */
if (ASIC_IS_AVIVO(rdev)) {
reg = RREG32(AVIVO_D1CRTC_CONTROL) |
@ -415,8 +413,6 @@ int radeon_clocks_init(struct radeon_device *rdev)
{
int r;
ENTER();
r = radeon_static_clocks_init(rdev->ddev);
if (r) {
return r;
@ -561,8 +557,6 @@ int radeon_device_init(struct radeon_device *rdev,
int r;
int dma_bits;
ENTER();
DRM_INFO("radeon: Initializing kernel modesetting.\n");
rdev->shutdown = false;
rdev->ddev = ddev;
@ -901,7 +895,7 @@ u32_t drvEntry(int action, char *cmdline)
return 0;
};
}
dbgprintf("Radeon RC06 cmdline %s\n", cmdline);
dbgprintf("Radeon RC07 cmdline %s\n", cmdline);
enum_pci_devices();

View File

@ -77,8 +77,6 @@ int radeon_gart_table_vram_alloc(struct radeon_device *rdev)
{
int r;
ENTER();
if (rdev->gart.table.vram.robj == NULL) {
r = radeon_object_create(rdev, NULL,
rdev->gart.table_size,
@ -214,17 +212,11 @@ int radeon_gart_bind(struct radeon_device *rdev, unsigned offset,
}
mb();
radeon_gart_tlb_flush(rdev);
LEAVE();
return 0;
}
int radeon_gart_init(struct radeon_device *rdev)
{
ENTER();
if (rdev->gart.pages) {
return 0;
}

View File

@ -453,6 +453,8 @@ int radeon_crtc_set_base(struct drm_crtc *crtc, int x, int y,
// radeon_object_get_tiling_flags(obj->driver_private,
// &tiling_flags, NULL);
tiling_flags = 0;
if (tiling_flags & RADEON_TILING_MICRO)
DRM_ERROR("trying to scanout microtiled buffer\n");
@ -530,10 +532,10 @@ int radeon_crtc_set_base(struct drm_crtc *crtc, int x, int y,
WREG32(RADEON_CRTC_OFFSET + radeon_crtc->crtc_offset, crtc_offset);
WREG32(RADEON_CRTC_PITCH + radeon_crtc->crtc_offset, crtc_pitch);
if (old_fb && old_fb != crtc->fb) {
radeon_fb = to_radeon_framebuffer(old_fb);
// if (old_fb && old_fb != crtc->fb) {
// radeon_fb = to_radeon_framebuffer(old_fb);
// radeon_gem_object_unpin(radeon_fb->obj);
}
// }
/* Bytes per pixel may have changed */
radeon_bandwidth_update(rdev);

View File

@ -53,7 +53,7 @@ int radeon_object_init(struct radeon_device *rdev)
ENTER();
r = drm_mm_init(&mm_vram, 0x800000 >> PAGE_SHIFT,
((rdev->mc.aper_size - 0x800000) >> PAGE_SHIFT));
((rdev->mc.real_vram_size - 0x800000) >> PAGE_SHIFT));
if (r) {
DRM_ERROR("Failed initializing VRAM heap.\n");
return r;

View File

@ -143,7 +143,7 @@ void __stdcall move_cursor(cursor_t *cursor, int x, int y)
uint32_t gpu_addr;
WREG32(RADEON_CUR_HORZ_VERT_OFF,
(RADEON_CUR_LOCK | (hot_x << 16) | (hot_y << 16)));
(RADEON_CUR_LOCK | (hot_x << 16) | hot_y ));
WREG32(RADEON_CUR_HORZ_VERT_POSN,
(RADEON_CUR_LOCK | (x << 16) | y));

View File

@ -82,7 +82,7 @@ cursor_t* __stdcall select_cursor_kms(cursor_t *cursor)
if (ASIC_IS_AVIVO(rdev))
WREG32(AVIVO_D1CUR_SURFACE_ADDRESS + radeon_crtc->crtc_offset, gpu_addr);
else {
radeon_crtc->legacy_cursor_offset = gpu_addr - radeon_crtc->legacy_display_base_addr;
radeon_crtc->legacy_cursor_offset = gpu_addr - rdev->mc.vram_location;
/* offset is from DISP(2)_BASE_ADDRESS */
WREG32(RADEON_CUR_OFFSET + radeon_crtc->crtc_offset, radeon_crtc->legacy_cursor_offset);
}
@ -148,7 +148,7 @@ void __stdcall move_cursor_kms(cursor_t *cursor, int x, int y)
y *= 2;
WREG32(RADEON_CUR_HORZ_VERT_OFF + radeon_crtc->crtc_offset,
(RADEON_CUR_LOCK | (hot_x << 16) | (hot_y << 16)));
(RADEON_CUR_LOCK | (hot_x << 16) | hot_y ));
WREG32(RADEON_CUR_HORZ_VERT_POSN + radeon_crtc->crtc_offset,
(RADEON_CUR_LOCK | (x << 16) | y));

View File

@ -439,7 +439,8 @@ APP_OBJ_OFFSET equ 48
APP_EV_OFFSET equ 40
struc CURSOR
{;common object header
{
;common object header
.magic dd ? ;'CURS'
.destroy dd ? ;internal destructor
.fd dd ? ;next object in list
@ -450,6 +451,7 @@ struc CURSOR
.base dd ? ;allocated memory
.hot_x dd ? ;hotspot coords
.hot_y dd ?
.sizeof:
}
virtual at 0
CURSOR CURSOR
@ -511,6 +513,37 @@ virtual at 0
SMAP SMAP
end virtual
struc display_t
{
.x dd ?
.y dd ?
.width dd ?
.height dd ?
.bpp dd ?
.vrefresh dd ?
.pitch dd ?
.lfb dd ?
.modes dd ?
.ddev dd ?
.connector dd ?
.crtc dd ?
.cr_list.next dd ?
.cr_list.prev dd ?
.cursor dd ?
.init_cursor dd ?
.select_cursor dd ?
.show_cursor dd ?
.move_cursor dd ?
.restore_cursor dd ?
}
virtual at 0
display_t display_t
end virtual
struc HEAP_DATA
{
@ -595,7 +628,8 @@ struc PG_DATA
;}
struc SRV
{ .srv_name rb 16 ;ASCIIZ string
{
.srv_name rb 16 ;ASCIIZ string
.magic dd ? ;+0x10 ;'SRV '
.size dd ? ;+0x14 ;size of structure SRV
.fd dd ? ;+0x18 ;next SRV descriptor
@ -603,10 +637,10 @@ struc SRV
.base dd ? ;+0x20 ;service base address
.entry dd ? ;+0x24 ;service START function
.srv_proc dd ? ;+0x28 ;main service handler
.sizeof:
}
SRV_FD_OFFSET equ 0x18
SRV_SIZE equ 44
DRV_ENTRY equ 1
DRV_EXIT equ -1

View File

@ -315,7 +315,7 @@ proc srv_handler stdcall, ioctl:dword
cmp [edi+SRV.magic], ' SRV'
jne .fail
cmp [edi+SRV.size], SRV_SIZE
cmp [edi+SRV.size], SRV.sizeof
jne .fail
stdcall [edi+SRV.srv_proc], esi
@ -347,7 +347,7 @@ srv_handlerEx:
cmp [eax+SRV.magic], ' SRV'
jne .fail
cmp [eax+SRV.size], SRV_SIZE
cmp [eax+SRV.size], SRV.sizeof
jne .fail
stdcall [eax+SRV.srv_proc], ebx
@ -402,8 +402,8 @@ proc reg_service stdcall, name:dword, handler:dword
cmp [handler], eax
je .fail
mov eax, SRV_SIZE
call malloc ;call alloc_service
mov eax, SRV.sizeof
call malloc
test eax, eax
jz .fail
@ -411,13 +411,15 @@ proc reg_service stdcall, name:dword, handler:dword
push edi
mov edi, eax
mov esi, [name]
mov ecx, 16/4
rep movsd
movsd
movsd
movsd
movsd
pop edi
pop esi
mov [eax+SRV.magic], ' SRV'
mov [eax+SRV.size], SRV_SIZE
mov [eax+SRV.size], SRV.sizeof
mov ebx, srv.fd-SRV_FD_OFFSET
mov edx, [ebx+SRV.fd]
@ -611,7 +613,10 @@ proc load_file stdcall, file_name:dword
jz .cleanup
mov [file2], eax
pushfd
cli
stdcall unpack, [file], eax
popfd
stdcall kernel_free, [file]
mov eax, [file2]
mov ebx, [file_size]
@ -1084,15 +1089,15 @@ proc load_library stdcall, file_name:dword
endp
align 4
proc stop_all_services
stop_all_services:
push ebp
mov edx, [srv.fd]
.next:
cmp edx, srv.fd-SRV_FD_OFFSET
je .done
cmp [edx+SRV.magic], ' SRV'
jne .next
cmp [edx+SRV.size], SRV_SIZE
cmp [edx+SRV.size], SRV.sizeof
jne .next
mov ebx, [edx+SRV.entry]
@ -1105,8 +1110,8 @@ proc stop_all_services
pop edx
jmp .next
.done:
pop ebp
ret
endp
; param
; eax= size

View File

@ -167,7 +167,7 @@ proc map_io_mem stdcall, base:dword, size:dword, flags:dword
@@:
mov [page_tabs+eax*4], edx
; push eax
; invlpg [ebx]
invlpg [ebx]
; pop eax
inc eax
add ebx, edi
@ -205,7 +205,7 @@ commit_pages:
@@:
mov [page_tabs+ebx*4], eax
; push eax
; invlpg [edi]
invlpg [edi]
; pop eax
add edi, edx
add eax, edx
@ -991,19 +991,19 @@ sysfn_meminfo:
align 4
f68call:
dd f68.11
dd f68.12
dd f68.13
dd f68.14
dd f68.11 ; init_heap
dd f68.12 ; user_alloc
dd f68.13 ; user_free
dd f68.14 ; get_event_ex
dd f68.fail ;moved to f68.24
dd f68.16
dd f68.17
dd f68.16 ; get_service
dd f68.17 ; call_service
dd f68.fail ;moved to f68.25
dd f68.19
dd f68.20
dd f68.21
dd f68.22
dd f68.23
dd f68.19 ; load_dll
dd f68.20 ; user_realloc
dd f68.21 ; load_driver
dd f68.22 ; shmem_open
dd f68.23 ; shmem_close
dd f68.24
dd f68.25
@ -1038,13 +1038,6 @@ f68:
call get_event_ex
mov [esp+36], eax
ret
.24:
mov eax, [current_slot]
xchg ebx, [eax+APPDATA.exc_handler]
xchg ecx, [eax+APPDATA.except_mask]
mov [esp+36], ebx ; reg_eax+8
mov [esp+24], ecx ; reg_ebx+8
ret
.16:
test ebx, ebx
jz .fail
@ -1057,15 +1050,6 @@ f68:
call srv_handlerEx ;ebx
mov [esp+36], eax
ret
.25:
cmp ebx,32
jae .fail
mov eax, [current_slot]
btr [eax+APPDATA.except_mask],ebx
setc byte[esp+36]
jecxz @f
bts [eax+APPDATA.except_mask],ebx
@@: ret
.19:
cmp ebx, OS_BASE
jae .fail
@ -1113,6 +1097,23 @@ f68:
stdcall shmem_close, ebx
mov [esp+36], eax
ret
.24:
mov eax, [current_slot]
xchg ebx, [eax+APPDATA.exc_handler]
xchg ecx, [eax+APPDATA.except_mask]
mov [esp+36], ebx ; reg_eax+8
mov [esp+24], ecx ; reg_ebx+8
ret
.25:
cmp ebx,32
jae .fail
mov eax, [current_slot]
btr [eax+APPDATA.except_mask],ebx
setc byte[esp+36]
jecxz @f
bts [eax+APPDATA.except_mask],ebx
@@:
ret
.fail:
xor eax, eax

View File

@ -280,6 +280,8 @@ L40:
__exports:
export 'KERNEL', \
alloc_kernel_space, 'AllocKernelSpace', \ ; stdcall
alloc_page, 'AllocPage', \ ; gcc ABI
alloc_pages, 'AllocPages', \ ; stdcall
commit_pages, 'CommitPages', \ ; eax, ebx, ecx
create_kernel_object, 'CreateObject', \
create_ring_buffer, 'CreateRingBuffer', \ ; stdcall
@ -287,7 +289,6 @@ __exports:
free_kernel_space, 'FreeKernelSpace', \ ; stdcall
kernel_alloc, 'KernelAlloc', \ ; stdcall
kernel_free, 'KernelFree', \ ; stdcall
alloc_pages, 'AllocPages', \ ; stdcall
malloc, 'Kmalloc', \
free, 'Kfree', \
map_io_mem, 'MapIoMem', \ ; stdcall
@ -307,6 +308,7 @@ __exports:
pci_write16, 'PciWrite16', \ ; stdcall
pci_write32, 'PciWrite32', \ ; stdcall
\
get_service, 'GetService', \ ;
reg_service, 'RegService', \ ; stdcall
attach_int_handler, 'AttachIntHandler', \ ; stdcall
user_alloc, 'UserAlloc', \ ; stdcall

View File

@ -329,6 +329,8 @@ os_stack_seg rd 1
srv.fd rd 1
srv.bk rd 1
_display display_t
scr_width rd 1
scr_height rd 1

View File

@ -349,14 +349,19 @@ high_code:
; mov [0xF604],byte 1 ;al
mov al, [BOOT_VAR+0x901F] ; DMA access
mov [allow_dma_access], al
mov al,[BOOT_VAR+0x9000] ; bpp
movzx eax, byte [BOOT_VAR+0x9000] ; bpp
mov [ScreenBPP],al
mov [_display.bpp], eax
mov [_display.vrefresh], 60
movzx eax,word [BOOT_VAR+0x900A] ; X max
mov [_display.width], eax
dec eax
mov [Screen_Max_X],eax
mov [screen_workarea.right],eax
movzx eax,word [BOOT_VAR+0x900C] ; Y max
mov [_display.height], eax
dec eax
mov [Screen_Max_Y],eax
mov [screen_workarea.bottom],eax
@ -369,8 +374,9 @@ high_code:
je @f
cmp [SCR_MODE],word 0x12 ; VGA 640x480
je @f
mov ax,[BOOT_VAR+0x9001] ; for other modes
movzx eax, word[BOOT_VAR+0x9001] ; for other modes
mov [BytesPerScanLine],ax
mov [_display.pitch], eax
@@:
mov esi, BOOT_VAR+0x9080
movzx ecx, byte [esi-1]