summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nvflinger
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-02-12 01:03:31 +0100
committerbunnei <bunneidev@gmail.com>2018-02-12 03:00:41 +0100
commit6fce1414c3a899c3694fd05518101a82ff8060ce (patch)
treee8e58a4eeb778e8540be65dd1b09dcc1411ff797 /src/core/hle/service/nvflinger
parentvi: Fix OpenLayer and CreateStrayLayer. (diff)
downloadyuzu-6fce1414c3a899c3694fd05518101a82ff8060ce.tar
yuzu-6fce1414c3a899c3694fd05518101a82ff8060ce.tar.gz
yuzu-6fce1414c3a899c3694fd05518101a82ff8060ce.tar.bz2
yuzu-6fce1414c3a899c3694fd05518101a82ff8060ce.tar.lz
yuzu-6fce1414c3a899c3694fd05518101a82ff8060ce.tar.xz
yuzu-6fce1414c3a899c3694fd05518101a82ff8060ce.tar.zst
yuzu-6fce1414c3a899c3694fd05518101a82ff8060ce.zip
Diffstat (limited to 'src/core/hle/service/nvflinger')
-rw-r--r--src/core/hle/service/nvflinger/buffer_queue.cpp3
-rw-r--r--src/core/hle/service/nvflinger/buffer_queue.h16
-rw-r--r--src/core/hle/service/nvflinger/nvflinger.cpp2
3 files changed, 18 insertions, 3 deletions
diff --git a/src/core/hle/service/nvflinger/buffer_queue.cpp b/src/core/hle/service/nvflinger/buffer_queue.cpp
index f90c7ca51..ff7b6b039 100644
--- a/src/core/hle/service/nvflinger/buffer_queue.cpp
+++ b/src/core/hle/service/nvflinger/buffer_queue.cpp
@@ -58,12 +58,13 @@ const IGBPBuffer& BufferQueue::RequestBuffer(u32 slot) const {
return itr->igbp_buffer;
}
-void BufferQueue::QueueBuffer(u32 slot) {
+void BufferQueue::QueueBuffer(u32 slot, BufferTransformFlags transform) {
auto itr = std::find_if(queue.begin(), queue.end(),
[&](const Buffer& buffer) { return buffer.slot == slot; });
ASSERT(itr != queue.end());
ASSERT(itr->status == Buffer::Status::Dequeued);
itr->status = Buffer::Status::Queued;
+ itr->transform = transform;
}
boost::optional<const BufferQueue::Buffer&> BufferQueue::AcquireBuffer() {
diff --git a/src/core/hle/service/nvflinger/buffer_queue.h b/src/core/hle/service/nvflinger/buffer_queue.h
index 5c6719407..ef9732769 100644
--- a/src/core/hle/service/nvflinger/buffer_queue.h
+++ b/src/core/hle/service/nvflinger/buffer_queue.h
@@ -46,18 +46,32 @@ public:
BufferQueue(u32 id, u64 layer_id);
~BufferQueue() = default;
+ enum class BufferTransformFlags : u32 {
+ /// Flip source image horizontally (around the vertical axis)
+ FlipH = 0x01,
+ /// Flip source image vertically (around the horizontal axis)
+ FlipV = 0x02,
+ /// Rotate source image 90 degrees clockwise
+ Rotate90 = 0x04,
+ /// Rotate source image 180 degrees
+ Roate180 = 0x03,
+ /// Rotate source image 270 degrees clockwise
+ Roate270 = 0x07,
+ };
+
struct Buffer {
enum class Status { Free = 0, Queued = 1, Dequeued = 2, Acquired = 3 };
u32 slot;
Status status = Status::Free;
IGBPBuffer igbp_buffer;
+ BufferTransformFlags transform;
};
void SetPreallocatedBuffer(u32 slot, IGBPBuffer& buffer);
u32 DequeueBuffer(u32 pixel_format, u32 width, u32 height);
const IGBPBuffer& RequestBuffer(u32 slot) const;
- void QueueBuffer(u32 slot);
+ void QueueBuffer(u32 slot, BufferTransformFlags transform);
boost::optional<const Buffer&> AcquireBuffer();
void ReleaseBuffer(u32 slot);
u32 Query(QueryType type);
diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp
index fe622b986..2089462b7 100644
--- a/src/core/hle/service/nvflinger/nvflinger.cpp
+++ b/src/core/hle/service/nvflinger/nvflinger.cpp
@@ -145,7 +145,7 @@ void NVFlinger::Compose() {
ASSERT(nvdisp);
nvdisp->flip(igbp_buffer.gpu_buffer_id, igbp_buffer.offset, igbp_buffer.format,
- igbp_buffer.width, igbp_buffer.height, igbp_buffer.stride);
+ igbp_buffer.width, igbp_buffer.height, igbp_buffer.stride, buffer->transform);
buffer_queue->ReleaseBuffer(buffer->slot);
}