mirror of
https://github.com/hyprwm/aquamarine.git
synced 2024-11-17 09:35:59 +01:00
work
This commit is contained in:
parent
abd58530c3
commit
588893c07b
2 changed files with 21 additions and 13 deletions
|
@ -37,6 +37,7 @@ Aquamarine::CDRMDumbBuffer::CDRMDumbBuffer(const SAllocatorBufferParams& params,
|
||||||
|
|
||||||
attrs.size = pixelSize;
|
attrs.size = pixelSize;
|
||||||
attrs.fd = request.handle;
|
attrs.fd = request.handle;
|
||||||
|
attrs.stride = stride;
|
||||||
|
|
||||||
drm_mode_map_dumb request2 = {
|
drm_mode_map_dumb request2 = {
|
||||||
.handle = handle,
|
.handle = handle,
|
||||||
|
@ -115,7 +116,9 @@ Aquamarine::CDRMDumbAllocator::~CDRMDumbAllocator() {
|
||||||
}
|
}
|
||||||
|
|
||||||
SP<CDRMDumbAllocator> Aquamarine::CDRMDumbAllocator::create(int drmfd_, Hyprutils::Memory::CWeakPointer<CBackend> backend_) {
|
SP<CDRMDumbAllocator> Aquamarine::CDRMDumbAllocator::create(int drmfd_, Hyprutils::Memory::CWeakPointer<CBackend> backend_) {
|
||||||
return SP<CDRMDumbAllocator>(new CDRMDumbAllocator(drmfd_, backend_));
|
auto a = SP<CDRMDumbAllocator>(new CDRMDumbAllocator(drmfd_, backend_));
|
||||||
|
a->self = a;
|
||||||
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
SP<IBuffer> Aquamarine::CDRMDumbAllocator::acquire(const SAllocatorBufferParams& params, SP<CSwapchain> swapchain_) {
|
SP<IBuffer> Aquamarine::CDRMDumbAllocator::acquire(const SAllocatorBufferParams& params, SP<CSwapchain> swapchain_) {
|
||||||
|
|
|
@ -256,6 +256,8 @@ std::vector<SP<CDRMBackend>> Aquamarine::CDRMBackend::attempt(SP<CBackend> backe
|
||||||
newPrimary = drmBackend;
|
newPrimary = drmBackend;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
drmBackend->dumbAllocator = CDRMDumbAllocator::create(gpu->fd, backend);
|
||||||
|
|
||||||
backends.emplace_back(drmBackend);
|
backends.emplace_back(drmBackend);
|
||||||
|
|
||||||
// so that session can handle udev change/remove events for this gpu
|
// so that session can handle udev change/remove events for this gpu
|
||||||
|
@ -1652,19 +1654,24 @@ SP<IBackendImplementation> Aquamarine::CDRMOutput::getBackend() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Aquamarine::CDRMOutput::setCursor(SP<IBuffer> buffer, const Vector2D& hotspot) {
|
bool Aquamarine::CDRMOutput::setCursor(SP<IBuffer> buffer, const Vector2D& hotspot) {
|
||||||
auto bufferType = buffer->type();
|
|
||||||
|
|
||||||
if ((bufferType == eBufferType::BUFFER_TYPE_SHM && !buffer->shm().success) || (bufferType == eBufferType::BUFFER_TYPE_DMABUF && !buffer->dmabuf().success)) {
|
|
||||||
backend->backend->log(AQ_LOG_ERROR, "drm: Invalid buffer passed to setCursor");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!connector->crtc)
|
if (!connector->crtc)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!buffer)
|
if (!buffer)
|
||||||
setCursorVisible(false);
|
setCursorVisible(false);
|
||||||
else {
|
else {
|
||||||
|
auto bufferType = buffer->type();
|
||||||
|
|
||||||
|
if (!buffer->good()) {
|
||||||
|
backend->backend->log(AQ_LOG_ERROR, "drm: bad buffer passed to setCursor");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((bufferType == eBufferType::BUFFER_TYPE_SHM && !buffer->shm().success) || (bufferType == eBufferType::BUFFER_TYPE_DMABUF && !buffer->dmabuf().success)) {
|
||||||
|
backend->backend->log(AQ_LOG_ERROR, "drm: Invalid buffer passed to setCursor");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
SP<CDRMFB> fb;
|
SP<CDRMFB> fb;
|
||||||
|
|
||||||
if (backend->primary) {
|
if (backend->primary) {
|
||||||
|
@ -1933,9 +1940,7 @@ uint32_t Aquamarine::CDRMFB::submitBuffer() {
|
||||||
uint32_t newID = 0;
|
uint32_t newID = 0;
|
||||||
|
|
||||||
if (buffer->type() == eBufferType::BUFFER_TYPE_DMABUF) {
|
if (buffer->type() == eBufferType::BUFFER_TYPE_DMABUF) {
|
||||||
|
|
||||||
auto attrs = buffer->dmabuf();
|
auto attrs = buffer->dmabuf();
|
||||||
|
|
||||||
std::array<uint64_t, 4> mods = {0, 0, 0, 0};
|
std::array<uint64_t, 4> mods = {0, 0, 0, 0};
|
||||||
for (size_t i = 0; i < attrs.planes; ++i) {
|
for (size_t i = 0; i < attrs.planes; ++i) {
|
||||||
mods[i] = attrs.modifier;
|
mods[i] = attrs.modifier;
|
||||||
|
|
Loading…
Reference in a new issue