diff mbox

[3/6] xf86drmMode: Make atomic request structures visible

Message ID 1439945924-22630-3-git-send-email-human.hwang@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Hyungwon Hwang Aug. 19, 2015, 12:58 a.m. UTC
This patch makes 'struct _drmModeAtomicReqItem' and 'struct
_drmModeAtomicReq' visible from outside. This is needed for userspace
applications to use those structures when calling drmModeAtomicCommit().

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
---
 xf86drmMode.c | 14 --------------
 xf86drmMode.h | 12 ++++++++++++
 2 files changed, 12 insertions(+), 14 deletions(-)

Comments

Emil Velikov Aug. 20, 2015, 4:23 p.m. UTC | #1
On 19 August 2015 at 01:58, Hyungwon Hwang <human.hwang@samsung.com> wrote:
> This patch makes 'struct _drmModeAtomicReqItem' and 'struct
> _drmModeAtomicReq' visible from outside. This is needed for userspace
> applications to use those structures when calling drmModeAtomicCommit().
>
Hmmm what is missing in the current API, that one needs direct access
to the structs ? If we expose these to the user we'll be putting a
(ABI) hedgehog down our pants (i.e. it might be ok, but will likely
result in a very painful experience).

Thanks
Emil
Hyungwon Hwang Aug. 21, 2015, 6:06 a.m. UTC | #2
Hi Emil,

On Thu, 20 Aug 2015 17:23:09 +0100
Emil Velikov <emil.l.velikov@gmail.com> wrote:

> On 19 August 2015 at 01:58, Hyungwon Hwang <human.hwang@samsung.com>
> wrote:
> > This patch makes 'struct _drmModeAtomicReqItem' and 'struct
> > _drmModeAtomicReq' visible from outside. This is needed for
> > userspace applications to use those structures when calling
> > drmModeAtomicCommit().
> >
> Hmmm what is missing in the current API, that one needs direct access
> to the structs ? If we expose these to the user we'll be putting a
> (ABI) hedgehog down our pants (i.e. it might be ok, but will likely
> result in a very painful experience).

I also agree with you. I think I should drop this patch, and find
another way for modetest.

Thanks.

Best regards,
Hyungwon Hwang

> 
> Thanks
> Emil
Pekka Paalanen Aug. 21, 2015, 6:44 a.m. UTC | #3
On Fri, 21 Aug 2015 15:06:58 +0900
Hyungwon Hwang <human.hwang@samsung.com> wrote:

> Hi Emil,
> 
> On Thu, 20 Aug 2015 17:23:09 +0100
> Emil Velikov <emil.l.velikov@gmail.com> wrote:
> 
> > On 19 August 2015 at 01:58, Hyungwon Hwang <human.hwang@samsung.com>
> > wrote:
> > > This patch makes 'struct _drmModeAtomicReqItem' and 'struct
> > > _drmModeAtomicReq' visible from outside. This is needed for
> > > userspace applications to use those structures when calling
> > > drmModeAtomicCommit().

Yeah, this sounds like a very bad idea.


Thanks,
pq

> > >
> > Hmmm what is missing in the current API, that one needs direct access
> > to the structs ? If we expose these to the user we'll be putting a
> > (ABI) hedgehog down our pants (i.e. it might be ok, but will likely
> > result in a very painful experience).
> 
> I also agree with you. I think I should drop this patch, and find
> another way for modetest.
Hyungwon Hwang Aug. 21, 2015, 7:35 a.m. UTC | #4
Dear,

On Fri, 21 Aug 2015 09:44:42 +0300
Pekka Paalanen <ppaalanen@gmail.com> wrote:

> On Fri, 21 Aug 2015 15:06:58 +0900
> Hyungwon Hwang <human.hwang@samsung.com> wrote:
> 
> > Hi Emil,
> > 
> > On Thu, 20 Aug 2015 17:23:09 +0100
> > Emil Velikov <emil.l.velikov@gmail.com> wrote:
> > 
> > > On 19 August 2015 at 01:58, Hyungwon Hwang
> > > <human.hwang@samsung.com> wrote:
> > > > This patch makes 'struct _drmModeAtomicReqItem' and 'struct
> > > > _drmModeAtomicReq' visible from outside. This is needed for
> > > > userspace applications to use those structures when calling
> > > > drmModeAtomicCommit().
> 
> Yeah, this sounds like a very bad idea.

Yes. Making it visible was not good. But then I think that new API for
getting the value of a request item in the request which are not
applied to the kernel. Because for preparing the buffer, the userspace
program needs width and height which are in the request.

The program can get the value before making it as a request. In that
case, the program such as modetest, which does not understand what the
object id or propery id means, have to be modified to understand them
for extracting the needed value.

How do you think about it? Is modetest just a special program for
testing, and is this support not needed for another real program?

> 
> 
> Thanks,
> pq
> 
> > > >
> > > Hmmm what is missing in the current API, that one needs direct
> > > access to the structs ? If we expose these to the user we'll be
> > > putting a (ABI) hedgehog down our pants (i.e. it might be ok, but
> > > will likely result in a very painful experience).
> > 
> > I also agree with you. I think I should drop this patch, and find
> > another way for modetest.
diff mbox

Patch

diff --git a/xf86drmMode.c b/xf86drmMode.c
index 82c4c91..cf3fa21 100644
--- a/xf86drmMode.c
+++ b/xf86drmMode.c
@@ -1164,20 +1164,6 @@  int drmModeObjectSetProperty(int fd, uint32_t object_id, uint32_t object_type,
 	return DRM_IOCTL(fd, DRM_IOCTL_MODE_OBJ_SETPROPERTY, &prop);
 }
 
-typedef struct _drmModeAtomicReqItem drmModeAtomicReqItem, *drmModeAtomicReqItemPtr;
-
-struct _drmModeAtomicReqItem {
-	uint32_t object_id;
-	uint32_t property_id;
-	uint64_t value;
-};
-
-struct _drmModeAtomicReq {
-	uint32_t cursor;
-	uint32_t size_items;
-	drmModeAtomicReqItemPtr items;
-};
-
 drmModeAtomicReqPtr drmModeAtomicAlloc(void)
 {
 	drmModeAtomicReqPtr req;
diff --git a/xf86drmMode.h b/xf86drmMode.h
index fe14078..ec05ed8 100644
--- a/xf86drmMode.h
+++ b/xf86drmMode.h
@@ -485,6 +485,18 @@  extern int drmModeObjectSetProperty(int fd, uint32_t object_id,
 				    uint64_t value);
 
 
+struct _drmModeAtomicReqItem {
+	uint32_t object_id;
+	uint32_t property_id;
+	uint64_t value;
+};
+typedef struct _drmModeAtomicReqItem drmModeAtomicReqItem, *drmModeAtomicReqItemPtr;
+
+struct _drmModeAtomicReq {
+	uint32_t cursor;
+	uint32_t size_items;
+	drmModeAtomicReqItemPtr items;
+};
 typedef struct _drmModeAtomicReq drmModeAtomicReq, *drmModeAtomicReqPtr;
 
 extern drmModeAtomicReqPtr drmModeAtomicAlloc(void);