NV: Expose the nvdisp_disp0 device and a weak reference to the nvdrv:a service.
NVFlinger will call into the nvdisp_disp0 device to perform screen flips, bypassing the ioctl interface. We now have the address of the framebuffer to draw, we just need to actually put it on the screen.
This commit is contained in:
parent
e21fbd9ae5
commit
34ae2ec644
6 changed files with 276 additions and 196 deletions
|
@ -6,6 +6,7 @@
|
|||
#include "common/scope_exit.h"
|
||||
#include "core/core_timing.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/service/nvdrv/nvdrv_a.h"
|
||||
#include "core/hle/service/vi/vi.h"
|
||||
#include "core/hle/service/vi/vi_m.h"
|
||||
|
||||
|
@ -743,7 +744,19 @@ void NVFlinger::Compose() {
|
|||
continue;
|
||||
}
|
||||
|
||||
// TODO(Subv): Send the buffer to the GPU for drawing.
|
||||
auto& igbp_buffer = buffer->igbp_buffer;
|
||||
|
||||
// Now send the buffer to the GPU for drawing.
|
||||
auto nvdrv = NVDRV::nvdrv_a.lock();
|
||||
ASSERT(nvdrv);
|
||||
|
||||
// TODO(Subv): Support more than just disp0. The display device selection is probably based
|
||||
// on which display we're drawing (Default, Internal, External, etc)
|
||||
auto nvdisp = nvdrv->GetDevice<NVDRV::nvdisp_disp0>("/dev/nvdisp_disp0");
|
||||
ASSERT(nvdisp);
|
||||
|
||||
nvdisp->flip(igbp_buffer.gpu_buffer_id, igbp_buffer.offset, igbp_buffer.format,
|
||||
igbp_buffer.width, igbp_buffer.height, igbp_buffer.stride);
|
||||
|
||||
buffer_queue->ReleaseBuffer(buffer->slot);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,8 @@ struct IGBPBuffer {
|
|||
u32_le gpu_buffer_id;
|
||||
INSERT_PADDING_WORDS(17);
|
||||
u32_le nvmap_handle;
|
||||
INSERT_PADDING_WORDS(61);
|
||||
u32_le offset;
|
||||
INSERT_PADDING_WORDS(60);
|
||||
};
|
||||
|
||||
static_assert(sizeof(IGBPBuffer) == 0x16C, "IGBPBuffer has wrong size");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue