forked from KolibriOS/kolibrios
kms: pre rc7
git-svn-id: svn://kolibrios.org@1275 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
e586c535b0
commit
b81d03be4e
@ -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);
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -67,7 +67,7 @@ static void radeon_show_cursor()
|
||||
WREG32(RADEON_MM_DATA, AVIVO_D1CURSOR_EN |
|
||||
(AVIVO_D1CURSOR_MODE_24BPP << AVIVO_D1CURSOR_MODE_SHIFT));
|
||||
} else {
|
||||
WREG32(RADEON_MM_INDEX, RADEON_CRTC_GEN_CNTL);
|
||||
WREG32(RADEON_MM_INDEX, RADEON_CRTC_GEN_CNTL);
|
||||
WREG32_P(RADEON_MM_DATA, (RADEON_CRTC_CUR_EN |
|
||||
(RADEON_CRTC_CUR_MODE_24BPP << RADEON_CRTC_CUR_MODE_SHIFT)),
|
||||
~(RADEON_CRTC_CUR_EN | RADEON_CRTC_CUR_MODE_MASK));
|
||||
@ -139,11 +139,11 @@ void __stdcall move_cursor(cursor_t *cursor, int x, int y)
|
||||
WREG32(AVIVO_D1CUR_POSITION, (x << 16) | y);
|
||||
WREG32(AVIVO_D1CUR_HOT_SPOT, (hot_x << 16) | hot_y);
|
||||
WREG32(AVIVO_D1CUR_SIZE, ((w - 1) << 16) | 31);
|
||||
} else {
|
||||
} else {
|
||||
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));
|
||||
|
||||
@ -163,9 +163,9 @@ void __stdcall restore_cursor(int x, int y)
|
||||
|
||||
bool init_display(struct radeon_device *rdev, mode_t *usermode)
|
||||
{
|
||||
struct drm_device *dev;
|
||||
struct drm_device *dev;
|
||||
|
||||
cursor_t *cursor;
|
||||
cursor_t *cursor;
|
||||
bool retval = true;
|
||||
u32_t ifl;
|
||||
|
||||
@ -177,17 +177,17 @@ bool init_display(struct radeon_device *rdev, mode_t *usermode)
|
||||
|
||||
ifl = safe_cli();
|
||||
{
|
||||
list_for_each_entry(cursor, &rdisplay->cursors, list)
|
||||
{
|
||||
init_cursor(cursor);
|
||||
};
|
||||
list_for_each_entry(cursor, &rdisplay->cursors, list)
|
||||
{
|
||||
init_cursor(cursor);
|
||||
};
|
||||
|
||||
rdisplay->restore_cursor(0,0);
|
||||
rdisplay->init_cursor = init_cursor;
|
||||
rdisplay->select_cursor = select_cursor;
|
||||
rdisplay->show_cursor = NULL;
|
||||
rdisplay->move_cursor = move_cursor;
|
||||
rdisplay->restore_cursor = restore_cursor;
|
||||
rdisplay->restore_cursor(0,0);
|
||||
rdisplay->init_cursor = init_cursor;
|
||||
rdisplay->select_cursor = select_cursor;
|
||||
rdisplay->show_cursor = NULL;
|
||||
rdisplay->move_cursor = move_cursor;
|
||||
rdisplay->restore_cursor = restore_cursor;
|
||||
|
||||
select_cursor(rdisplay->cursor);
|
||||
radeon_show_cursor();
|
||||
|
@ -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));
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user