#v4l 2015-12-11,Fri

↑back Search ←Prev date Next date→ Show only urls(Click on time to select a line by its url)

WhoWhatWhen
hverkuilmchehab: irclogger seems dead again. [12:03]
..... (idle for 20mn)
mchehabweird, the script seems to be running there
http://linuxtv.org/irc/irclogger_log/v4l?date=2015-12-11,Fri
seems to be working
perhaps some transitory disconnect
[12:23]
hverkuilAh, I see what causes the confusion: as long as there are no 'real' messages, the logger will not create a new entry for the day. So as soon as I asked the question, the page for Friday was added :-) [12:28]
mchehabyes [12:38]
javier__hverkuil: https://en.wikipedia.org/wiki/Observer_effect_(physics) :) [12:48]
mchehab:-D
it seems that writing a message on IRC changes the quantum state of LinuxTV.org :-D
[12:49]
javier__mchehab: haha [12:50]
.... (idle for 19mn)
MJRiderNelis: mchehab quantum bugs are the best ;-) [13:09]
mchehaboh, yes! [13:09]
awalls1They are neither a bug nor correct code until you observe them. [13:12]
javier__awalls1: and when you observe it, it's always a bug :P [13:14]
mchehabjavier__: actually, if you don't observe the IRC channel, the chances are 50%
you only have 100% if you observe both linuxtv.org and IRC ;)
[13:24]
javier__mchehab: haha [13:28]
mchehabin other words, reading one, changes the quantum state of the other ;) [13:29]
javier__: FYI, I'm adding the new MC patches on my experimental tree at media-controller-rc3 [13:42]
javier__mchehab: Ok, I'll rebase on top of that before posting my fixes/cleanups
mchehab: but is unlikely that our patches are going to conflict since mine are mostly on platform drivers
[13:42]
mchehabjavier__: yes, true [13:47]
............. (idle for 1h1mn)
pinchartl, hverkuil, shuah, javier__: there's one point from the patch review that may require a quick discussion
from my TODO list: Discuss the MEDIA_IOC_G_TOPOLOGY ioctl: use u64 instead of pointers? Change the reserved fields?
this action item was generated per pinchartl's review of this patch: uapi/media.h: Add MEDIA_IOC_G_TOPOLOGY ioctl
[14:48]
shuahok with quick discussion [14:51]
mchehabhttps://www.mail-archive.com/linux-media@vger.kernel.org/msg94057.html [14:51]
pinchartlregarding __u64 vs void * I don't have a strong opinion, but it seems that the rest of the kernel does [14:52]
javier__pinchartl: yes, it seems that __u64 is the current trend [14:53]
pinchartlit helps with compat32 handling
and if we switch to __u64 then we can use __u32 for reserved fields at the end of the structure, it won't make a difference
[14:53]
juliushi [14:54]
pinchartlalso, one thing I was wondering, is whether we could do without the reserved fields completely
I got the idea while working on DRM code
[14:55]
javier__pinchartl: agreed, since pointers are self-aligned to different byte boundaries for 32 and 64 bit [14:55]
pinchartlthey match the ioctl based on the ioctl number only, not the structure size
and when they need to add fields that just extends the structure and increases its size, so kernel code can cope
[14:55]
mchehabpinchartl: yes, we don't actually need reserved fields at all [14:56]
juliusinserting my camera shows me this dmesg output: http://pastebin.ca/3281981 the camera works, but even with auto exposure off set to manual i only get around 9fps. does the dmesg output show that it is not supported and i just dont see it? [14:56]
mchehabI think I pointed that approach during the MC workshop
the input/evdev does that too
they use the size increase to detect new versions
[14:56]
pinchartlit's a departure from the ioctl model used by v4l though [14:57]
mchehabyes [14:57]
pinchartlno strong opinion either there
but if we want to do that for MC
we should do it sooner than later
before we get too many ioctls
[14:57]
mchehabfrom my side, let's do it
so, it seems that both you and I agree with:
1) keep using the v2 names, removing the FIXME comment;
2) use u64 for the pointers;
3) don't use reserved fields
right?
[14:58]
pinchartlfor the _v2 names let me sleep over it. for the rest, I agree
(and speaking of sleeping over it I'll spend half a day in a plane on Sunday, with time to review the remaining patches)
[14:59]
shuahas for me sounds good - going with u64 is a good thing [15:00]
pinchartlI'd like hverkuil's opinion on __u64 too [15:00]
mchehabdidn't you finish? I assumed that you finished since you promised doing that before this monday...
the patches got already applied at the media-controller branch, as agreed
[15:00]
pinchartlI've seen your e-mail about that
I've sent you a message, not sure if it was in an e-mail or in here, telling you that I had ~1/3 of the patches remaining
[15:01]
mchehabof course if you find issues, they could be fixed later [15:01]
pinchartl(it was 5am and I had a flight the next day^W^Wsame morning) [15:01]
mchehabweird, I didn't receive any such message from you [15:02]
pinchartlit was on the 6th of December if I recall properly [15:02]
mchehablast message I got from you was this one:
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>, Mauro Carvalho Chehab <mchehab@infradead.org>, linux-sh@vger.kernel.org
Subject: Re: [PATCH v8 01/55] [media] media: create a macro to get entity ID
Date: Sun, 06 Dec 2015 05:20:20 +0200
[15:03]
pinchartlit could have been on IRC [15:03]
hverkuilReading up on the discussion... [15:04]
mchehabI had a bug on my IRC daemon on that weekend
and the IRC logger was not working after the machine migration
[15:04]
hverkuilRegarding 1: I don't like the v2 name, but I don't have a better idea... [15:04]
mchehab(the current logs were rebuilt from what I had on my own logs) [15:04]
pinchartlserver upgrades always hurt :-/ [15:06]
mchehabhverkuil: we ended by doing something like adding a _v2_ when we added IR support at the input/evdev
hverkuil: and with regards to (2) and (3)?
[15:06]
hverkuilRegarding 2: how much does going to u64 actually help? You still need compat code due to alignment differences. This would be the only ioctl in the media API that uses u64 for a pointer. I really don't think u64 will help you much, if anything, and it would be completely out of line with the existing API. I vote against. [15:08]
pinchartlhverkuil: if we switch to __u64 we should use it for all future ioctls [15:10]
mchehabyes [15:10]
javier__hverkuil: the alignment differences will depend on how you organize the files in the struct [15:10]
hverkuilRegarding 3: I have no strong opinion on this. If this can be done cleanly in the core code, then I'm OK with that. [15:10]
javier__hverkuil: with you u64 you can avoid a compat ioctl if things are well organized
s/files/fields
[15:11]
mchehabwe can avoid align issues if we use _u64 instead of _u32 at media_v2_topology [15:11]
hverkuiljavier__: you still need compat code to convert the pointers. [15:11]
pinchartlthe whole point it to avoid compat code completely [15:12]
shuahhverkuil: is it the concern that having one ioctl using __u64 is very diferent from all others - leading to confusion [15:12]
mchehabI've no idea how compat would work for u32 pointers on an u64 struct.... [15:14]
hverkuilHow can you avoid compat code? As I understand it you always need to convert the pointers. If that's not the case, then using u64 might be a good idea. [15:14]
mchehabwell, let's ask [15:14]
hverkuilBasically going for u64 instead of void * only makes sense if you can avoid the compat code altogether. [15:15]
mchehabmaybe Arnd knows the answer, as he suggested the usage of:
static inline void __user *get_upointer(u64 arg)
{
return (void __user *)(uintptr_t)arg;
}
to get it
[15:15]
pinchartlthat's the idea [15:15]
hverkuilIf you have to write compat code anyway, then I see no point in doing this due to the inconsistent API that you introduce. [15:15]
mchehabso, if all agree, for (2), we'll double check if no compatible code is needed
if this is the case, we'll go for it
[15:16]
pinchartlthat could would be the same for 32-bit and 64-bit [15:16]
hverkuil(and the num_foo fields should be u64 as well in that case to avoid holes in the struct) [15:16]
mchehabpinchartl: yes, I guess that, if userspace is 32 bits, that code should work fine, even if the Kernel is 64 bits
yes, at the struct, we should only use u64 ints
this way, it should likely be compat32 safe
[15:16]
hverkuilHmm, the contents of the pointers should also all be compat32 safe, but I think that's the case. [15:17]
pinchartlif we can't avoid compat32 code I agree that using __u64 is pointless [15:18]
arndthere is one small issue to watch out for: if you have a struct that contains at least one __u64, you need to ensure that the size is a multiple of 64 bit, otherwise x86 will still need a compat handling [15:18]
shuahYes that is my opinion as well [15:18]
arnd"struct foo { __u64 a ; __u32 b; };" is 12 bytes on x86-32, but 16 bytes on all other architectures, 32 and 64 bit [15:19]
pinchartlarnd: and we need to ensure that the u64 field is 64-bit aligned I suppose [15:19]
mchehabarnd: if we warrant that everything is u64 there, and we use the above macro, we won't need any compat32 code for this? [15:19]
arndcorrect [15:19]
mchehabOK, good! [15:19]
hverkuilOK, then I agree. [15:19]
pinchartl"struct foo { __u32 a; __u64 b; __u32 c; }" wouldn't work, but "struct foo { __u64 b; __u32 a; __u32 c; }" would [15:19]
mchehabso, for (2), we'll then go to u64, as everybody agreed [15:19]
shuahok that sounds good [15:19]
hverkuilI do think in that case it would be useful to add static inlines that convert the u64 to the appropriate pointer. [15:20]
javier__pinchartl: yes, that's what I meant by organizing the fields in the struct
pinchartl: having the fields sizes in decreasing order
[15:20]
mchehabpinchartl: true, but our struct has 5 u32 and 4 pointers
better to change everything to u64
[15:20]
hverkuilI agree. [15:21]
arndit's not a problem to have __u32 members in the struct really, as long as they come in pairs [15:21]
hverkuilarnd: they don't in this case :-( [15:21]
mchehabyes, but we actually have one u32 one pointer per pair [15:21]
shuahso you might need reserved fields to round them off in somce cases [15:22]
mchehabstruct media_v2_topology {
__u32 topology_version;
__u32 num_entities;
struct media_v2_entity *entities;
__u32 num_interfaces;
struct media_v2_interface *interfaces;
__u32 num_pads;
struct media_v2_pad *pads;
__u32 num_links;
struct media_v2_link *links;
}
[15:22]
hverkuilOh well, as least we can cope with 2^64 entities. Nobody can accuse us of not being future-proof in this case! [15:22]
mchehab:) [15:22]
arndUsing __u8 is not enough, right? [15:23]
mchehabno
u16 might work
[15:23]
arndyou still need padding with __u16 unfortunately [15:24]
mchehabbut won't solve, so lets move to u64 and be it [15:24]
hverkuilIt's no big deal to use u64 for everything here. [15:24]
mchehabno, it isn't
ok, with regards to (3), let's remove the reserved stuff?
[15:24]
javier__so it should be something like this: [15:25]
arndagreed. It only matters if the struct becomes too large for the kernel stack, the time to copy it matters for a fast path [15:25]
javier__struct media_v2_topology { __u64 entities; __u64 interfaces; __u64 pads; __u64 links; __u32 topology_version; __u32 num_entities; __u32 num_interfaces; __u32 num_pads; __u32 num_links; __u32 padding;
sorry for that...
I meant: http://hastebin.com/xuhivafaze.avrasm
[15:25]
hverkuiljavier__: you can't easily add new num_foo & u64 foo fields later.
in that proposed structure
[15:26]
shuahright with the last pad fields [15:26]
hverkuilmchehab: regarding 3: it depends on the impact on the core code. If it can be added cleanly, then I have no objection. [15:27]
pinchartlI have to run I'm afraid, I'm already late [15:27]
shuahany changes to the structure will have ensure alignment [15:27]
mchehabhttp://pastie.org/10625511this sounds better, IMHO
http://pastie.org/10625511
hverkuil: not much to be changed at the core code
[15:27]
shuahThat looks good to me [15:28]
mchehabif the size of the struct increases [15:28]
javier__mchehab: but then you will need a compat code since the __u64 pointer will have different sizes in 32 and 64 bit
IOW, is the same to have __u64 * than void *
or am I missing something?
[15:29]
mchehabops... I mean __u64 entities and so on [15:29]
hverkuilmchehab: you mean just u64 instead of u64 * :-) [15:29]
mchehabyes [15:29]
javier__mchehab: oh, sorry [15:29]
mchehabcut-and-paste mistake [15:30]
javier__mchehab: yes, your proposal looks better to me as well [15:30]
mchehabhverkuil: to add a new field, there are actually two ways: [15:30]
hverkuilalthough I would suggest naming it ptr_entities instead of entities. Without the '*' you wouldn't know it is a pointer unless the name says so. [15:30]
mchehab1) add a new ioctl macro for the version with the bigger size;
2) change the ioctl code to strip away the size and then use a macro that will get the size of the struct that userspace sent
what about: entities_p, interfaces_p, pads_p, links_p
[15:30]
hverkuilfine too, but I like the alternating num_foo; ptr_foo; It looks nice :-) [15:32]
mchehabworks for me [15:32]
hverkuilnum_foo; foo_p; looks weird
foo_num; foo_ptr; would also be OK.
[15:32]
mchehabok...
I'll be preparing the patches for it...
for now, I'll keep the _v2_ at the names, removing the FIXME
and change the struct to use u64 and removing the reserved fields
we can change the _v2_ names later if someone comes with some better idea
(but before 4.5 final, of course ;) )
[15:33]
shuahmchehab: maybe you can do a pastebin for the final to get a quick ok, so patch review goes quicker [15:35]
mchehabhttp://pastie.org/10625539 [15:38]
hverkuilack [15:39]
mchehabideally, the macros won't be returning void pointers, but struct media_v2_foo * ones [15:39]
javier__cool [15:39]
shuahack [15:40]
mchehabgood. I'll work on the patch and post at the ML once it is done
thank you all!
[15:41]
............ (idle for 56mn)
***benjiG has left [16:37]
.......................... (idle for 2h8mn)
awalls1 has left [18:45]

↑back Search ←Prev date Next date→ Show only urls(Click on time to select a line by its url)