Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
KWin
Commits
f2bf7fb1
Commit
f2bf7fb1
authored
Dec 06, 2021
by
Xaver Hugl
Committed by
Aleix Pol Gonzalez
Dec 23, 2021
Browse files
linuxdmabuf: allow setting the default tranches
parent
3ef4f994
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/wayland/linuxdmabufv1clientbuffer.cpp
View file @
f2bf7fb1
...
...
@@ -307,17 +307,17 @@ void LinuxDmaBufV1ClientBufferIntegration::setRendererInterface(RendererInterfac
d
->
rendererInterface
=
rendererInterface
;
}
void
LinuxDmaBufV1ClientBufferIntegration
::
setSupportedFormatsWithModifiers
(
dev_t
mainDevice
,
const
QHash
<
uint32_t
,
QSet
<
uint64_t
>>
&
set
)
void
LinuxDmaBufV1ClientBufferIntegration
::
setSupportedFormatsWithModifiers
(
const
QVector
<
LinuxDmaBufV1Feedback
::
Tranche
>
&
tranches
)
{
if
(
d
->
supportedModifiers
!=
set
||
d
->
mainDevice
!=
mainDevice
)
{
if
(
LinuxDmaBufV1FeedbackPrivate
::
get
(
d
->
defaultFeedback
.
data
())
->
m_tranches
!=
tranches
)
{
QHash
<
uint32_t
,
QSet
<
uint64_t
>>
set
;
for
(
const
auto
&
tranche
:
tranches
)
{
set
.
insert
(
tranche
.
formatTable
);
}
d
->
supportedModifiers
=
set
;
d
->
mainDevice
=
mainD
evice
;
d
->
mainDevice
=
tranches
.
first
().
d
evice
;
d
->
table
.
reset
(
new
LinuxDmaBufV1FormatTable
(
set
));
LinuxDmaBufV1Feedback
::
Tranche
tranche
;
tranche
.
device
=
mainDevice
;
tranche
.
flags
=
{};
tranche
.
formatTable
=
set
;
d
->
defaultFeedback
->
setTranches
({
tranche
});
d
->
defaultFeedback
->
setTranches
(
tranches
);
}
}
...
...
src/wayland/linuxdmabufv1clientbuffer.h
View file @
f2bf7fb1
...
...
@@ -59,6 +59,36 @@ private:
friend
class
LinuxDmaBufParamsV1
;
};
class
KWAYLANDSERVER_EXPORT
LinuxDmaBufV1Feedback
:
public
QObject
{
Q_OBJECT
public:
~
LinuxDmaBufV1Feedback
()
override
;
enum
class
TrancheFlag
:
uint32_t
{
Scanout
=
1
,
};
Q_DECLARE_FLAGS
(
TrancheFlags
,
TrancheFlag
)
struct
Tranche
{
dev_t
device
;
TrancheFlags
flags
;
QHash
<
uint32_t
,
QSet
<
uint64_t
>>
formatTable
;
};
/**
* Sets the list of tranches for this feedback object, with lower indices
* indicating a higher priority / a more optimal configuration.
* The main device does not need to be included
*/
void
setTranches
(
const
QVector
<
Tranche
>
&
tranches
);
private:
LinuxDmaBufV1Feedback
(
LinuxDmaBufV1ClientBufferIntegrationPrivate
*
integration
);
friend
class
LinuxDmaBufV1ClientBufferIntegrationPrivate
;
friend
class
LinuxDmaBufV1FeedbackPrivate
;
QScopedPointer
<
LinuxDmaBufV1FeedbackPrivate
>
d
;
};
/**
* The LinuxDmaBufV1ClientBufferIntegration class provides support for linux dma-buf buffers.
*/
...
...
@@ -104,41 +134,11 @@ public:
*/
void
setRendererInterface
(
RendererInterface
*
rendererInterface
);
void
setSupportedFormatsWithModifiers
(
dev_t
mainDevice
,
const
QHash
<
uint32_t
,
QSet
<
uint64_t
>>
&
set
);
void
setSupportedFormatsWithModifiers
(
const
QVector
<
LinuxDmaBufV1Feedback
::
Tranche
>
&
tranches
);
private:
friend
class
LinuxDmaBufV1ClientBufferIntegrationPrivate
;
QScopedPointer
<
LinuxDmaBufV1ClientBufferIntegrationPrivate
>
d
;
};
class
KWAYLANDSERVER_EXPORT
LinuxDmaBufV1Feedback
:
public
QObject
{
Q_OBJECT
public:
~
LinuxDmaBufV1Feedback
()
override
;
enum
class
TrancheFlag
:
uint32_t
{
Scanout
=
1
,
};
Q_DECLARE_FLAGS
(
TrancheFlags
,
TrancheFlag
)
struct
Tranche
{
dev_t
device
;
TrancheFlags
flags
;
QHash
<
uint32_t
,
QSet
<
uint64_t
>>
formatTable
;
};
/**
* Sets the list of tranches for this feedback object, with lower indices
* indicating a higher priority / a more optimal configuration.
* The main device does not need to be included
*/
void
setTranches
(
const
QVector
<
Tranche
>
&
tranches
);
private:
LinuxDmaBufV1Feedback
(
LinuxDmaBufV1ClientBufferIntegrationPrivate
*
integration
);
friend
class
LinuxDmaBufV1ClientBufferIntegrationPrivate
;
friend
class
LinuxDmaBufV1FeedbackPrivate
;
QScopedPointer
<
LinuxDmaBufV1FeedbackPrivate
>
d
;
};
}
// namespace KWaylandServer
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment