From c8609aed8c8a08efb64efe47f0c718b032c77dea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 12 May 2006 11:46:14 +0000 Subject: [PATCH] * Now allocates enough memory for virtual screens. * Implemented untested B_MOVE_DISPLAY - note, the page_flip demo doesn't work yet (didn't investigate yet, though). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17432 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../accelerants/intel_extreme/mode.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/add-ons/accelerants/intel_extreme/mode.cpp b/src/add-ons/accelerants/intel_extreme/mode.cpp index 57ffdf01c7..e4b24a3713 100644 --- a/src/add-ons/accelerants/intel_extreme/mode.cpp +++ b/src/add-ons/accelerants/intel_extreme/mode.cpp @@ -250,10 +250,10 @@ intel_set_display_mode(display_mode *mode) intel_free_memory(gInfo->frame_buffer_handle); uint32 offset; - if (intel_allocate_memory(bytesPerRow * current.timing.v_display, + if (intel_allocate_memory(bytesPerRow * current.virtual_height, gInfo->frame_buffer_handle, offset) < B_OK) { // oh, how did that happen? Unfortunately, there is no really good way back - if (intel_allocate_memory(gInfo->shared_info->current_mode.timing.v_display + if (intel_allocate_memory(gInfo->shared_info->current_mode.virtual_height * gInfo->shared_info->bytes_per_row, gInfo->frame_buffer_handle, offset) == B_OK) { gInfo->shared_info->frame_buffer_offset = offset; @@ -379,7 +379,20 @@ status_t intel_move_display(uint16 horizontalStart, uint16 verticalStart) { TRACE(("intel_move_display()\n")); - return B_ERROR; + display_mode &mode = gInfo->shared_info->current_mode; + + if (horizontalStart + mode.timing.h_display > mode.virtual_width + || verticalStart + mode.timing.v_display > mode.virtual_height) + return B_BAD_VALUE; + + mode.h_display_start = horizontalStart; + mode.v_display_start = verticalStart; + + write32(INTEL_DISPLAY_BASE, gInfo->shared_info->frame_buffer_offset + + verticalStart * gInfo->shared_info->bytes_per_row + + horizontalStart * (gInfo->shared_info->bits_per_pixel + 7) / 8); + + return B_OK; }