Re: help: is there any way to use integer 64 type in protocol?

2014-04-21 Thread Jason Ekstrand
On Sun, Apr 20, 2014 at 8:36 PM, Wang, Quanxian quanxian.w...@intel.comwrote:





 *From:* Jason Ekstrand [mailto:ja...@jlekstrand.net]
 *Sent:* Monday, April 21, 2014 6:32 AM
 *To:* Pekka Paalanen
 *Cc:* Wang, Quanxian; wayland-devel@lists.freedesktop.org
 *Subject:* Re: help: is there any way to use integer 64 type in protocol?







 On Sun, Apr 20, 2014 at 1:17 PM, Pekka Paalanen ppaala...@gmail.com
 wrote:

  On Sun, 20 Apr 2014 11:10:15 +
 Wang, Quanxian quanxian.w...@intel.com wrote:

  Hi,
 
  Is there any way to use type of integer 64bit in protocol?

 No. You will have to use two 32-bit arguments, or propose a patch
 to add 64-bit types in a completely backwards-compatible way. I am
 not sure what the latter option would entail.



 Adding 64-bit types wouldn't be too hard.  It would involve adding a
 int64_t an uint64_t types to wl_argument (I'd call them U and I personally)
 and adding code throughout libwayland to parse them.  In terms of backwards
 compatibility, it should be fine as long as you make it 100% clear that
 your new protocol extension uses the new 64bit types and therefore requires
 the newer libwayland version.

 The other option is that you could do what Pekka did in the presentation
 extension and split it into two 32-bit parts.  What do you want to
 represent that needs a 64-bit type?

 *[Wang, Quanxian] 32 is too short. Currently I use 32bit in Weston randr,
 it could only stand for 16 type of operations (every type use 2 bits,
 however 12 of 16 have been used.). It will be fine to use 64 bit or more
 for future extension. I will try to add a patch for that. Thanks for your
 comment.*

As Thiago pointed out, we can't actually add that at this point (sorry, I
forgot about the 32-bit machine issue).  Also, if you're using a bitfield
and you think there's a reasonable chance of 32 bits being too small, then
there is probably also a reasonable chance of 64 bits being too small.  It
might be a good idea to consider other ways of representing it.  What
exactly are you representing in this bitfield?

Thanks,
--Jason Ekstrand


   Thanks,

 --Jason Ekstrand




 The presentation extension could make use of a 64-bit type, too.



 Thanks,
 pq
 ___
 wayland-devel mailing list
 wayland-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/wayland-devel



___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: help: is there any way to use integer 64 type in protocol?

2014-04-21 Thread Jason Ekstrand
On Sun, Apr 20, 2014 at 5:41 PM, Thiago Macieira thi...@kde.org wrote:

 Em dom 20 abr 2014, às 17:31:48, Jason Ekstrand escreveu:
  Adding 64-bit types wouldn't be too hard.  It would involve adding a
  int64_t an uint64_t types to wl_argument (I'd call them U and I
 personally)
  and adding code throughout libwayland to parse them.  In terms of
 backwards
  compatibility, it should be fine as long as you make it 100% clear that
  your new protocol extension uses the new 64bit types and therefore
 requires
  the newer libwayland version.

 That changes the size and alignment of wl_argument on 32-bit platforms. No
 can
 do until libwayland 2.0, with a binary compatibility break.


Yeah, you're right.  Thanks for catching that.  In retrospect, I should
have put a 64 bit place-holder in the union when it was first added to
ensure that it was 64 bits on both platforms.  But, like you said, can't
change it now.
--Jason



 --
 Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
   PGP/GPG: 0x6EF45358; fingerprint:
   E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

 ___
 wayland-devel mailing list
 wayland-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/wayland-devel

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: help: is there any way to use integer 64 type in protocol?

2014-04-20 Thread Pekka Paalanen
On Sun, 20 Apr 2014 11:10:15 +
Wang, Quanxian quanxian.w...@intel.com wrote:

 Hi,
 
 Is there any way to use type of integer 64bit in protocol?

No. You will have to use two 32-bit arguments, or propose a patch
to add 64-bit types in a completely backwards-compatible way. I am
not sure what the latter option would entail.

The presentation extension could make use of a 64-bit type, too.


Thanks,
pq
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: help: is there any way to use integer 64 type in protocol?

2014-04-20 Thread Jason Ekstrand
On Sun, Apr 20, 2014 at 1:17 PM, Pekka Paalanen ppaala...@gmail.com wrote:

 On Sun, 20 Apr 2014 11:10:15 +
 Wang, Quanxian quanxian.w...@intel.com wrote:

  Hi,
 
  Is there any way to use type of integer 64bit in protocol?

 No. You will have to use two 32-bit arguments, or propose a patch
 to add 64-bit types in a completely backwards-compatible way. I am
 not sure what the latter option would entail.


Adding 64-bit types wouldn't be too hard.  It would involve adding a
int64_t an uint64_t types to wl_argument (I'd call them U and I personally)
and adding code throughout libwayland to parse them.  In terms of backwards
compatibility, it should be fine as long as you make it 100% clear that
your new protocol extension uses the new 64bit types and therefore requires
the newer libwayland version.

The other option is that you could do what Pekka did in the presentation
extension and split it into two 32-bit parts.  What do you want to
represent that needs a 64-bit type?

Thanks,
--Jason Ekstrand



 The presentation extension could make use of a 64-bit type, too.



 Thanks,
 pq
 ___
 wayland-devel mailing list
 wayland-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/wayland-devel

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: help: is there any way to use integer 64 type in protocol?

2014-04-20 Thread Thiago Macieira
Em dom 20 abr 2014, às 17:31:48, Jason Ekstrand escreveu:
 Adding 64-bit types wouldn't be too hard.  It would involve adding a
 int64_t an uint64_t types to wl_argument (I'd call them U and I personally)
 and adding code throughout libwayland to parse them.  In terms of backwards
 compatibility, it should be fine as long as you make it 100% clear that
 your new protocol extension uses the new 64bit types and therefore requires
 the newer libwayland version.

That changes the size and alignment of wl_argument on 32-bit platforms. No can 
do until libwayland 2.0, with a binary compatibility break.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
  PGP/GPG: 0x6EF45358; fingerprint:
  E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


RE: help: is there any way to use integer 64 type in protocol?

2014-04-20 Thread Wang, Quanxian


From: Jason Ekstrand [mailto:ja...@jlekstrand.net]
Sent: Monday, April 21, 2014 6:32 AM
To: Pekka Paalanen
Cc: Wang, Quanxian; wayland-devel@lists.freedesktop.org
Subject: Re: help: is there any way to use integer 64 type in protocol?



On Sun, Apr 20, 2014 at 1:17 PM, Pekka Paalanen 
ppaala...@gmail.commailto:ppaala...@gmail.com wrote:
On Sun, 20 Apr 2014 11:10:15 +
Wang, Quanxian quanxian.w...@intel.commailto:quanxian.w...@intel.com 
wrote:

 Hi,

 Is there any way to use type of integer 64bit in protocol?
No. You will have to use two 32-bit arguments, or propose a patch
to add 64-bit types in a completely backwards-compatible way. I am
not sure what the latter option would entail.

Adding 64-bit types wouldn't be too hard.  It would involve adding a int64_t an 
uint64_t types to wl_argument (I'd call them U and I personally) and adding 
code throughout libwayland to parse them.  In terms of backwards compatibility, 
it should be fine as long as you make it 100% clear that your new protocol 
extension uses the new 64bit types and therefore requires the newer libwayland 
version.
The other option is that you could do what Pekka did in the presentation 
extension and split it into two 32-bit parts.  What do you want to represent 
that needs a 64-bit type?
[Wang, Quanxian] 32 is too short. Currently I use 32bit in Weston randr, it 
could only stand for 16 type of operations (every type use 2 bits, however 12 
of 16 have been used.). It will be fine to use 64 bit or more for future 
extension. I will try to add a patch for that. Thanks for your comment.
Thanks,
--Jason Ekstrand


The presentation extension could make use of a 64-bit type, too.


Thanks,
pq
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.orgmailto:wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel