kloczek has quit [Read error: Connection reset by peer]
kloczek has joined #linux-exynos
TheSeven has quit [Ping timeout: 258 seconds]
TheSeven has joined #linux-exynos
TheSeven has quit [Ping timeout: 246 seconds]
TheSeven has joined #linux-exynos
TheSeven has quit [Ping timeout: 246 seconds]
[7] has joined #linux-exynos
wwilly__ has joined #linux-exynos
wwilly_ has quit [Ping timeout: 240 seconds]
nighty- has joined #linux-exynos
mszyprow has joined #linux-exynos
<mszyprow> memeka: ping
<mszyprow> memeka: are you sure a7 pmu is working (measuring anything) with your patch https://github.com/mihailescu2m/linux/commit/2ea365969b82868a053bc7b64c50c2037bcb8458 ? datasheet specifies 182-185 gic spi ports instead of 192-195 for A7 PMU
<memeka> mszyprow: it looked that way, the counters did appear in perf list
<memeka> I got the numbers from Hardkernel
<mszyprow> well, having them on perf list doesn't mean that it works
<mszyprow> you need to use some events and check if the event are really reported
<mszyprow> 192-195 vs. 182-185 looks like a typo
<memeka> The funny thing is hk could only get a7 working on 3.10 kernel
<memeka> :))
<memeka> I’ll try the counters after I put my son to sleep
<memeka> I’ll let u know
<wwilly__> I'm using https://pastebin.com/HgQ6ykSp since a while
<wwilly__> but I haven't used the a7 really...
<wwilly__> I will check right know too
<memeka> Thx wwilly__
<wwilly__> but values from the a15 seems working well
<wwilly__> coherent with my workload
<mszyprow> wwilly__: values for a15 match datasheets
<wwilly__> ok thanks
<memeka> mszyprow: yeah neither a7 or a15 hw counters work
<memeka> :(
<mszyprow> a15 counters should work
<wwilly__> a15 works with those numbers
<memeka> nope they don't
<wwilly__> I'm using perf_event_open and raw number directly though, not with perf tool
<memeka> perf record -e armv7_cortex_a15/cpu_cycles/ -ag taskset 0xF0 ffmpeg ....
<mszyprow> memeka: are you sure that the task is executed on a15?
<memeka> [ perf record: Captured and wrote 0.001 MB perf.data ]
<memeka> mszyprow: taskset 0xF0 :P
<memeka> i tried taskset 0x0F too, and get half the fps from 0xF0 :)
<memeka> i tried several A7 and several A15 counters... nada
<memeka> software counters worked
kxkamil has joined #linux-exynos
<memeka> anyway... │The perf.data file has no samples!
<wwilly__> by using perf_event_open it's working memeka
<mszyprow> I will check later, now I'm busy fixing other things...
<wwilly__> and I get the same shape for same counter on both a7 and a15 with my pmu definition
<memeka> wwilly__: how r you using perf_event_open?
<memeka> do you instrument, or just run outside the program?
<wwilly__> something like https://pastebin.com/6LkGWPQ4
<wwilly__> a monitor daemon/application open perf counter for pid/tid for particular cpu_id I want to
<wwilly__> and at regular time, it read, and reset it
<wwilly__> "man perf_event_open" but you know that already
<memeka> mszyprow: i tried with 182-185 for A7, same as before
<memeka> armv7_cortex_a7/cpu_cycles/
<memeka> [ 3.576153] genirq: Flags mismatch irq 113. 00000081 (10064000.tmu) vs. 00010c04 (arm-pmu)
<memeka> [ 3.595888] genirq: Flags mismatch irq 114. 00000081 (10068000.tmu) vs. 00010c04 (arm-pmu)
<memeka> [ 0.920264] hw perfevents: no interrupt-affinity property for /arm-pmu-a7, guessing.
<memeka> [ 0.920885] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 5 counters available
<memeka> mszyprow: with 192-195, i don't get the flags mismatch error
<mszyprow> my fault
<memeka> trying now with interrupt-afinity
<memeka> mszyprow: looking at the wrong manual? :P
<mszyprow> I confused tmu and pmu
<memeka> ok, A15 now works
<memeka> with intrerrupt-affinity set
<mszyprow> memeka: a7 pmus are on 160-163 GIC lines
_whitelogger has quit [K-Lined]
_whitelogger has joined #linux-exynos
<mszyprow> :)
<memeka> thanks mszyprow and wwilly__ for the affinity :P
<mszyprow> memeka: if you got it working, then send a patch to mainline ;P
<wwilly__> héhé memeka :)
<memeka> mszyprow: haha never sent one :) what's the procedure? :))
<wwilly__> memeka, could you sign me of?
<memeka> wwilly__: sure, what details?
<mszyprow> Documentation/process/submit-checklist.rst
<memeka> thx mszyprow
<wwilly__> memeka, Signed-off-by: Willy Wolff <willy.mh.wolff@gmail.com>
<mszyprow> memeka: make sure to use proper GIC macros (<GIC_SPI 160 IRQ_TYPE_LEVEL_HIGH> instead of <0 160 4>)
<wwilly__> I doubt my reading now .... because 192 worked for me
<wwilly__> I'm using mainline 4.11 though
<mszyprow> wwilly__: 192 is RESERVED, maybe it is also connected to a7 pmu, but the datasheets specifies that a7 pmu uses 160 GIC SPI port
<memeka> mszyprow: yes i was just about to mention that :)
<wwilly__> ah uhm ok
<wwilly__> that's the magic to not have all information
<wwilly__> and do you have some better macro for the a15 tooo?
<mszyprow> nope, combiner irq specifier is simply made of 2 numbers, first group no, then port no
<mszyprow> flags are hardcoded in the driver iirc
<wwilly__> ok
<memeka> mszyprow: does the diff looks good: http://paste.debian.net/991811/
<mszyprow> memeka: move it to exynos54xx.dtsi
<mszyprow> memeka: it is common to 5410, 5420, 5422 and 5800 SoCs
<memeka> mszyprow: it's not part of soc node, right?
<memeka> oh i think it is
<mszyprow> memeka: good question
<mszyprow> memeka: I would put it in soc
<mszyprow> as there is nothing outside it
<memeka> yes :)
<mszyprow> and exynos3250 also have it under soc
<mszyprow> memeka: once you generate a patch (a diff with subject, commit message and sign-offs), check it with "./scripts/checkpatch.pl PATCH_FILE" and send to all reported by "./scripts/get_maintainer.pl PATCH_FILE"
<mszyprow> memeka: better :) maybe extent first commit messge line to "Enable support for ARM Performance Monitoring Units available in Cortex-A7 and Cortex-A15 CPU cores for Exynos54xx SoCs (5410, 5420 and 5422/5800)."
<memeka> damn sent it already :P
<mszyprow> memeka: and add your "Signed-off-by: Marian Mihailescu <mihailescu2m@gmail.com>"
<memeka> time for V2
<mszyprow> maybe I can also get "Suggested-by: Marek Szyprowski <m.szyprowski@samsung.com>" ;)
<wwilly__> by the way, 5 counters and 7 counters, is it actually 4 and 6 programmable, + cycles at all time?
<memeka> ok V2 sent thanks mszyprow
<memeka> mszyprow: what's the "Scaler" ?
<mszyprow> memeka: Memory-to-Memory scaler
<memeka> it's not GScaler, issit?
<mszyprow> memeka: a bit more powerful comparing to GScaler
<memeka> There are 3 Scaler devices in Exynos5420 SoCs
<mszyprow> memeka: has almost no limits related to processed formats
<memeka> never heard of them until now
<mszyprow> memeka: while GScaler requires buffers to be aligned to 8 pixels
<memeka> i mean not even in the 3.x kernels were any reference to them, from what i can remember
<mszyprow> maybe noone advertized them ;)
<memeka> are there gonna be v4l2 drivers for them as well? :D
<mszyprow> I plan to make a generic v4l2 mem2mem driver on top of Exynos DRM IPP
<memeka> (or are there already patches ?:D)
<mszyprow> to avoid this dual-world mess
<memeka> tri-world :))
<memeka> v4l2, ipp, ippv2 :))
<memeka> crazy
<mszyprow> yea...
<mszyprow> :(
<mszyprow> ipp v1 is so broken that we shouldn't count it ;)
<memeka> is there any benefit in the v2 patches?
<mszyprow> you mean ipp v2?
<memeka> yeah
<mszyprow> it is working compared to ipp v1
<memeka> dunno what actually uses it :)
<mszyprow> state-less api
<memeka> as in, what was using it and had issues?
<mszyprow> nothing besides some Samsung internal things with additional patches
<mszyprow> memeka: ipp v2 has very simple userspace api
<mszyprow> memeka: all processing done by a single ioctl
<memeka> yeah but still it will be used mostly by the internal samsung stuff :)
<mszyprow> memeka: I hope not
<mszyprow> memeka: Tobias is already playing with it with libdrm and mpv
<memeka> yeah i saw that...
<mszyprow> memeka: and once v4l2 glue is done, it will be really usefull
<memeka> that's true ...
<mszyprow> and we can get rid of old v4l2-gsc driver
<memeka> after that, there will be more than internal samsung stuff that uses it :D
<memeka> well, my biggest gripe atm is mali drivers, but you can't help with that :))
<mszyprow> memeka: I do my best
<memeka> wayland works really well, except: there's no dmabuf support
<memeka> so software decoding ends up being better than MFC :)
<mszyprow> mali should be somehow resolved at higher level
<memeka> and also: there's no nested compositor support ... which is a shame :(
<mszyprow> memeka: btw, I've just finished porting DMAbuf support to mainline
<memeka> epiphany + nested compositor => gstreamer + elg in the browser :)
<mszyprow> mfc dmabuf
<memeka> *egl*
<memeka> mfc encoder?
<memeka> i mean, both decoder and encoder had dmabuf export working
nighty- has quit [Quit: Disappears in a puff of smoke]
<mszyprow> memeka: both, encoder and decoder
nighty- has joined #linux-exynos
nighty- has quit [Remote host closed the connection]
<memeka> patch? :D
nighty- has joined #linux-exynos
nighty- has quit [Remote host closed the connection]
<mszyprow> memeka: sent, please check
<memeka> cool thx
<mszyprow> memeka: ah, you asked about exporting
<mszyprow> memeka: patch is about importing
<mszyprow> exporting needs another patch
<memeka> mszyprow: there's also a MFC encoder patch that is important
<memeka> i found it a long time ago on chromebook ml
<memeka> so i can't attribute it :)
<memeka> without it, there is not pts coming out of the encoder :)
<mszyprow> hmm, there have been some discussion about those time stamps, but I must admit that I didn't track it
<mszyprow> hmmm, just checked that dmabuf export is already there for both encoder and decoder
<memeka> i just know that i had some issues with gst encoding (the output had no pts), found a discussion also about this on a chromebook forum, and adapted a patch from the 3.x kernel for 4.x
<memeka> yeah export is there - it was only encoder import that was important :)
<memeka> btw, latest ffmpeg released 3 days ago has MFC support (v4l2) :)
<memeka> but has no dmasupport yet, so it's pretty slow :D
<mszyprow> okay, so the last thing is to check the iommu related issues
<memeka> oh yeah iommu on drm dmabuf import
<memeka> i think i saw something about this on a page you maintain
<memeka> mainline to-do
<memeka> yes
<memeka> "with IOMMU, importing a dma-buf in exynos-drm leads to a system crash as well:"
<memeka> on 4.10 kernel
<memeka> i think it's the same thing i told you about
<mszyprow> memeka: that page is a bit outdated
<mszyprow> memeka: but yes, there are some items that need to be checked
<memeka> hm, this is funny :)
<memeka> A7 interrupts show as 192-195 :)
<mszyprow> memeka: the numbers you see in the /proc/interrupts are just logical numbers, they have nothing to hw ports numbers
<mszyprow> memeka: they are assigned incrementally when irq drivers registers to the system
<memeka> but i bet this is why HK had the 192-195 numbers
<mszyprow> ah, those numbers
<mszyprow> I thought about the first columns
<mszyprow> column
<mszyprow> the numbers in the name column is the driver specific name
<mszyprow> I have no idea what does it mean to GIC driver
<memeka> so <GIC_SPI 161> has the name "193"? :))
<mszyprow> yes, those are some GIC specific names, as the GIC are internally also cascaded
<memeka> i can understand the confusion :)
<mszyprow> anyway, in DTS you put the HW GIC port number, not the ID
<memeka> mszyprow: there's an issue with the pmu patch
<memeka> interrupt-affinity = <&cpu0>
<memeka> cpu0 is not defined yet
<memeka> sorry
<memeka> exynos5410-odroidxu.dtb: ERROR (phandle_references): Reference to non-existent node or label "cpu4"
<memeka> cpu4 is not defined on 5410
<mszyprow> ah, 5410 has only a7 cores defined
<memeka> so move it do 542x.dtsi ?
<memeka> or split it?
<mszyprow> hmm
<mszyprow> split will be fine
<memeka> a7 to 54xx and a15 to 542x?
<memeka> ok
<mszyprow> a7 to 54xx.dtsi and a15 to 5420.dtsi
kloczek has quit [Read error: Connection reset by peer]
kloczek has joined #linux-exynos
<memeka> where were these buffers allocated from? CMA or outside CMA?
<mszyprow> memeka: dedicated reserved areas for mfc driver are not needed after commit 60641e22599a61b8f0356aa8c3755ea26f17a62b
<memeka> but where these reserved areas from? CMA?
<mszyprow> memeka: driver will allocate memory from default (global) cma area
<mszyprow> memeka: these reserved buffers were carved out from system memory before that change
<mszyprow> memeka: and after patch 60641e22599a61b8f0356aa8c3755ea26f17a62b they are not used for MFC v6+
<memeka> yeah, i am trying now with 256mb CMA and i get memory allocation error after your patch :( let me see if i can find a cause
<mszyprow> that approach was too limited
<mszyprow> memeka: do you have commit d251510d4c2b6ffa42dfe6c270e1965daa23eca6 ?
<memeka> yes
<mszyprow> xu4?
<memeka> so they're not coming from CMA
<memeka> yes, xu4
<mszyprow> mfc will use global cma area
<memeka> i thought xu4 is mfc8?
<mszyprow> v6+ means v6, v7, v8
<memeka> so CMA is better than system memory?
<mszyprow> it allows larger allocations
<memeka> i found 128mb not enough for both encoder + decoder
<mszyprow> have you tried to add "s5p_mfc.mfc_mem_size=16M" to your kernel cmd line?
<mszyprow> or just mfc_mem_size=16M as module parameter if mfc is compiled as module?
<memeka> isn't that for firmware?
<memeka> in any case ...
<memeka> gst-launch-1.0 filesrc location=bunny_trailer_720p.mov ! parsebin ! v4l2video0dec capture-io-mode=mmap ! progressreport ! v4l2video1h264enc output-io-mode=mmap extra-controls="encode,h264_level=10,h264_profile=4,frame_level_rate_control_enable=1,video_bitrate=2097152" ! h264parse ! matroskamux ! filesink location=encoded.mkv
<memeka> this uses MMAP between mfc decoder and mfc encoder
<mszyprow> that's for firmware and for additional per-instance data
<memeka> it works before your code
<memeka> doesn't work after
<mszyprow> if you open more instances at the same time, the default 8m might be not enough
<memeka> (before the dma-buf import patch)
<mszyprow> if the dma buf import patch broke it, then it is not related to memory allocation
<memeka> v4l2video1h264enc0: Failed to allocate required memory.
<memeka> let me reboot with mfc_mem_size=16M
<memeka> mszyprow: s5p_mfc.mfc_mem_size=16M BUT s5p-mfc 11000000.codec: preallocated 8 MiB buffer for the firmware and context buffers
<memeka> puttin 16mb in the driver
<memeka> mszyprow: nope, after that patch the encoder cannot allocate any kind of memory
<mszyprow> it will take while to setup gst and plugins
<mszyprow> let me check again the code
<memeka> i tried software decode -> mfc encode => same error
<memeka> i tried 480p => v4l2video1h264enc0: Failed to allocate required memory
<mszyprow> maybe I mixed something
<mszyprow> comment out vb2_verify_memory_type() calls in the mfc code
<mszyprow> there are 4 or 5 of them
<mszyprow> okay, I found
<memeka> good :)
<mszyprow> s5p_mfc_enc.c line 50
<mszyprow> change &ctx->vq_dst to &ctx->vq_src
<mszyprow> too much copy/paste
<memeka> mszyprow: btw did you get the pmu patch v3 email?
<mszyprow> memeka: I nope
<mszyprow> memeka: neither v1 and v2
<memeka> so does the .pl script sends emails? :)
<mszyprow> nope
<memeka> oh what does it do? :D
<mszyprow> it only gives you the list of maintainers/lists
<mszyprow> git send-email
<mszyprow> memeka: then you can get back to v1 if was not really sent ;)
<memeka> yeah :P no spam
<mszyprow> does the change to &ctx->vq_src fixed encoding?
<memeka> line 50 you mean line 1180?
<memeka> the one here right: @@ -1164,6 +1164,10
<mszyprow> yea
<mszyprow> I should sleep a bit more, but it is hard if you have small children...
<memeka> yeah :) mine is almost 2 :D
<memeka> it crashes with dmabuf imp
<memeka> mszyprow: ok so mmap works now
<memeka> mszyprow: dmabuf import => kernel panic
<mszyprow> okay, then it needs more work :/
<memeka> this is the first one
<memeka> if i try again the run it => much bigger kernel error
<memeka> it says v4l2video0dec0 but decoder -> gscaler works with dmabuf
<memeka> so i still think it's encoder :)
<mszyprow> yes, encoder needs more tweaking, it has to wait until it gets all dst buffers before starting the hw
<mszyprow> memeka: what is the gst cmd to test dmabuf import to encoder? (I'm new to gst)
<memeka> mszyprow: gst-launch-1.0 filesrc location=bunny_trailer_480p.mov ! parsebin ! v4l2video0dec capture-io-mode=dmabuf ! v4l2video1h264enc output-io-mode=dmabuf-import extra-controls="encode,h264_level=10,h264_profile=4,frame_level_rate_control_enable=1,video_bitrate=2097152" ! h264parse ! matroskamux ! filesink location=encoded.mkv
<memeka> but you need gst patched to enable encoder support (not sure it made it yet to gst)
<memeka> i have it packaged in ubuntu 16.04 debs if that's ok
<mszyprow> well, I have debian unstable on my test device
<memeka> should work, let me upload them somewhere
<mszyprow> is it built from main gst repository or some fork?
<memeka> main gst repo + a few patches for the encoder
<memeka> actually not main gst repo, it's the latest release
<memeka> the ubuntu 17.10 source for gst (latest release) + encoder patches
<memeka> i think the encoder patches were supposed to make it in main repo soon
<memeka> they were under review or something
<memeka> but i did not follow if they're in yet
<mszyprow> memeka: could you point to the repo(s)?
<memeka> you need:
<memeka> last one contains the v4l2 code
<mszyprow> what about the encoder patches?
<memeka> not sure how long transfer.sh keeps files
<memeka> if you checkout tag 1.12.3 in all those repos
<memeka> it should be ok
<memeka> you just need to ignore the first and last patch in there - they're for the debian packaging files. just make sure to compile using the flag "--without-libv4l2" (the first patch adds that to debian/rules)
<memeka> or even better, you can install gst on debian unstable, and just apt-get source for gst-plugins-good
<memeka> apply the patches (now all should work), then rebuild just the gst-plugins-good
<memeka> anw
<memeka> mszyprow: finally, had to install several CPAN modules :|
<memeka> is the email ok now? :)
<mszyprow> memeka: I got the email
<mszyprow> memeka: what are CPAN modules?
<mszyprow> memeka: the only thing that has to be fixed is that patch should not be sent as attachment
<mszyprow> memeka: for git send-email you need to setup a few entries in .gitconfig (like smtpserver, smtpuser)
<javier___> mszyprow: I suggest you to use gst_uninstalled https://arunraghavan.net/2014/07/quick-start-guide-to-gst-uninstalled-1-x/
<javier___> that allows you to have a dev environment for gst and use the binary/libraries from that dev instead ones in the system
<javier___> *instead the ones
<mszyprow> javier___: thanks
<memeka> mszyprow: git send-email needed some perl modules :)
<mszyprow> memeka: well, you install and configure it once, then submitting patches is really simple
<javier___> memeka: I don't think the order of the S-o-B in your patch is correct
<mszyprow> javier___: the order looks fine assuming that memeka is the author and willy helped making it
<javier___> mszyprow: right
<javier___> btw, I also remember that importing a dma-buf into the exynos drm driver caused a system hang
<javier___> I may even be the one that added that entry into the wiki todo page
<javier___> by looking at my exynos notes, this is the gst pipeline I tested at the time:
<javier___> gst-launch-1.0 filesrc location=~/test.mp4 ! qtdemux ! h264parse ! v4l2video0dec capture-io-mode=dmabuf ! v4l2video6convert output-io-mode=dmabuf-import capture-io-mode=dmabuf ! kmssink force-modesetting=true
<memeka> javier___: yes, only when EXYNOS_IOMMU=y
<memeka> it's still causes a hand
<javier___> memeka: exactly, I meant with IOMMU enabled. With CMA it worked well for me
<memeka> yeah me too, 1080p movie with 5-8% cpu load on kms output :|
<javier___> and I also remember Nicolas Dufresne (v4l2 gst maintainer) also reported the same dma-buf import issue on exynos4
<javier___> which may imply that the problem is in the exynos drm driver, since for exynos5 is mfc -> gsc -> exynos drm but for exynos4 is mfc -> fimc -> exynos drm
<memeka> javier___: yes i agree
<memeka> with exynos_iommu=y, mfc -> gsc dmabuf-input -> other sink works fine
<memeka> it's so annoying samsung dropped Arktik 1020 :(
<memeka> for the exynos4 arktiks it provides a nice wayland mali drivers, including dmabuf-import
<memeka> for the exynos5422 1020 - they dropped it before a nice wayland driver was released
<memeka> damn!
mszyprow has quit [Ping timeout: 248 seconds]
LiquidAcid has joined #linux-exynos
nighty- has joined #linux-exynos
nighty- has quit [Ping timeout: 260 seconds]
kxkamil has quit [Quit: Leaving]
LiquidAcid has quit [Remote host closed the connection]
LiquidAcid has joined #linux-exynos
LiquidAcid has quit [Remote host closed the connection]
wwilly_ has joined #linux-exynos
wwilly__ has quit [Ping timeout: 246 seconds]
LiquidAcid has joined #linux-exynos
Vasco_O is now known as Vasco
LiquidAcid has quit [Quit: Leaving]
LiquidAcid has joined #linux-exynos
aballier has quit [Quit: leaving]
LiquidAcid has quit [Quit: Leaving]
LiquidAcid has joined #linux-exynos
ansiwon has quit [Ping timeout: 240 seconds]
LiquidAcid has quit [Quit: Leaving]
afaerber has joined #linux-exynos
afaerber has quit [Client Quit]