Re: Getting screen coordinate of a window

2024-01-28 Thread Michael Grunditz
In message <77f3e8285b.mickenx@armx6>
  Michael Grunditz  wrote:

> In message 

> In the loop that sets cpu .. how can I make it interrupting all cpus? I
> have tried this _irqdistr.write(1U<<31, i); or by
> adding a bitfield struct i Irouter.

It works now, a exercise not suitable for the faint of heart :-)

I still wonder how MU is supposed to work. I Need to trigger interrupt 
from the same "cpu" set of regs. But since it works I will not follow that 
down..

I have landed on having a "1" for irq routing. If this would be expanded I 
might do 1<<31 ,, but for now Genode doesn't have anything connected.

Michael

___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users


Re: Getting screen coordinate of a window

2024-01-26 Thread Michael Grunditz
In message 
  Stefan Kalkowski  wrote:

>

> So that is the software architectural limitation right now.
> Technically it should be no problem at all to route your interrupt to
> CPU 1. One way to achieve this within an Genode-only system without
> changing the IRQ service would be, to use the affinity of the caller
> to set the CPU target. But if I remember correctly you want to route
> the interrupt to a different core, which is managed by RISC OS. So in
> that case you could either use a hack (just hardcode it for the
> designated interrupts), or in the longer run the IRQ session gets
> equipped with a way to express the affinity explicitely. The latter
> solution however is nothing I would pledge to do overhasty. However,
> we have to re-think the quite simple form of the IRQ session in the
> midterm future anyway, because of other limitations, and we shall keep
> your use-case in the back of our heads therefore.

Replying from better client , thanks.

> For an instant hack, you might have a look at file:
>   repos/base-hw/src/bootstrap/spec/arm/gicv3.cc
> where the affinity routing of all interupts is initialized now. The
> interesting register is `Distributor::Irouter` (line 53 in my
> version).

If I understand it right by reading real world example ( freertos/m4/imx8) 
it seems like MU should be set up using boot core. The manual doesn't 
mention this. I have tried to change in 
repos/base-hw/src/bootstrap/spec/arm/gicv3.cc

In the loop that sets cpu .. how can I make it interrupting all cpus? I 
have tried this _irqdistr.write(1U<<31, i); or by 
adding a bitfield struct i Irouter.

Michael

___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users


Re: Getting screen coordinate of a window

2024-01-24 Thread Michael Grunditz
Thanks Stefan. I have actually tried routing it from gicv3 code. I have decide 
to rebase my interrupt Hal. Not home today but I think that it will fix my 
problem. Interrupts is to most hairy part of what I am doing now I need to do 
some init bits from the other core but at the same time not breaking it for 
Genode.

What’s the fun if everything works right away!

Michael 

> 24 jan. 2024 kl. 11:53 skrev Stefan Kalkowski 
> :
> 
> Hi Michael,
> 
>> On Tue, Jan 23, 2024 at 04:04:42PM +0100, Michael Grunditz wrote:
>> In message 
>>  Norman Feske  wrote:
>> Another issue:
>> I don't know if anyone knows about this but ( long shot :-) ),
>> I am relying on the imx8 message unit (MU). I have been using polling
>> against it, but now I need interrupts. But I can't get it to work. I am
>> trying to enable it on CPUB side. no effect. So I tried it in Genode CPUA
>> (Core 0) and after setting up interrupt in the MU chip I got interrupts
>> from the cpu. So the qeustion is: Is it only possible to set it on Core 0
>> and if so , can I route it to Core 1 in Genode. I have been looking in the
>> gicv3 code and it seems like it only does core 0. I have also tried to
>> enable it in genode and after that setting affinity on the second core (
>> from the second core). No effect. Interresting enough is that I can enable
>> SoC timer and get it to interrupt core 1 ( not setting anything in Genode
>> / Core 0).
> 
> The reason why we use a fixed route to CPU 0 for all interrupts here,
> is the fact that till now only one thread (on CPU 0) in core serves
> the interrupt service in base-hw. Moreover, the platform driver
> intercepted in the recent past the interrupt service to support
> interrupt sharing (also having just one thread, typically running on
> CPU 0), although it doesn't do this necessarily anymore for devices
> having distinct interrupts. Finally, the current interrupt service
> does not provide a way to tell core/kernel which CPU affinity to use
> for a specific interrupt.
> 
> So that is the software architectural limitation right now.
> Technically it should be no problem at all to route your interrupt to
> CPU 1. One way to achieve this within an Genode-only system without
> changing the IRQ service would be, to use the affinity of the caller
> to set the CPU target. But if I remember correctly you want to route
> the interrupt to a different core, which is managed by RISC OS. So in
> that case you could either use a hack (just hardcode it for the
> designated interrupts), or in the longer run the IRQ session gets
> equipped with a way to express the affinity explicitely. The latter
> solution however is nothing I would pledge to do overhasty. However,
> we have to re-think the quite simple form of the IRQ session in the
> midterm future anyway, because of other limitations, and we shall keep
> your use-case in the back of our heads therefore.
> 
> For an instant hack, you might have a look at file:
>  repos/base-hw/src/bootstrap/spec/arm/gicv3.cc
> where the affinity routing of all interupts is initialized now. The
> interesting register is `Distributor::Irouter` (line 53 in my
> version).
> 
> Best regards
> Stefan
> 
>> 
>> Michael
>> 
>> ___
>> Genode users mailing list
>> users@lists.genode.org
>> https://lists.genode.org/listinfo/users
> 
> --
> Stefan Kalkowski
> Genode labs
> 
> https://github.com/skalk | https://genode.org
> 
> ___
> Genode users mailing list
> users@lists.genode.org
> https://lists.genode.org/listinfo/users

___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users


Re: Getting screen coordinate of a window

2024-01-24 Thread Stefan Kalkowski
Hi Michael,

On Tue, Jan 23, 2024 at 04:04:42PM +0100, Michael Grunditz wrote:
> In message 
>   Norman Feske  wrote:
> Another issue:
> I don't know if anyone knows about this but ( long shot :-) ),
> I am relying on the imx8 message unit (MU). I have been using polling 
> against it, but now I need interrupts. But I can't get it to work. I am 
> trying to enable it on CPUB side. no effect. So I tried it in Genode CPUA 
> (Core 0) and after setting up interrupt in the MU chip I got interrupts 
> from the cpu. So the qeustion is: Is it only possible to set it on Core 0 
> and if so , can I route it to Core 1 in Genode. I have been looking in the 
> gicv3 code and it seems like it only does core 0. I have also tried to 
> enable it in genode and after that setting affinity on the second core ( 
> from the second core). No effect. Interresting enough is that I can enable 
> SoC timer and get it to interrupt core 1 ( not setting anything in Genode 
> / Core 0).

The reason why we use a fixed route to CPU 0 for all interrupts here,
is the fact that till now only one thread (on CPU 0) in core serves
the interrupt service in base-hw. Moreover, the platform driver
intercepted in the recent past the interrupt service to support
interrupt sharing (also having just one thread, typically running on
CPU 0), although it doesn't do this necessarily anymore for devices
having distinct interrupts. Finally, the current interrupt service
does not provide a way to tell core/kernel which CPU affinity to use
for a specific interrupt.

So that is the software architectural limitation right now.
Technically it should be no problem at all to route your interrupt to
CPU 1. One way to achieve this within an Genode-only system without
changing the IRQ service would be, to use the affinity of the caller
to set the CPU target. But if I remember correctly you want to route
the interrupt to a different core, which is managed by RISC OS. So in
that case you could either use a hack (just hardcode it for the
designated interrupts), or in the longer run the IRQ session gets
equipped with a way to express the affinity explicitely. The latter
solution however is nothing I would pledge to do overhasty. However,
we have to re-think the quite simple form of the IRQ session in the
midterm future anyway, because of other limitations, and we shall keep
your use-case in the back of our heads therefore.

For an instant hack, you might have a look at file:
  repos/base-hw/src/bootstrap/spec/arm/gicv3.cc
where the affinity routing of all interupts is initialized now. The
interesting register is `Distributor::Irouter` (line 53 in my
version).

Best regards
Stefan

> 
> Michael
> 
> ___
> Genode users mailing list
> users@lists.genode.org
> https://lists.genode.org/listinfo/users

-- 
Stefan Kalkowski
Genode labs

https://github.com/skalk | https://genode.org

___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users


Re: Getting screen coordinate of a window

2024-01-23 Thread Michael Grunditz
In message 
  Norman Feske  wrote:



> both the nitpicker GUI server as well as the wm deliver only absolute
> motion events. Events delivered by nitpicker refer to the upper-left
> corner of the screen. Events delivered by the wm "virtualize" this
> upper-left corner so that the real window position is not exposed to the
> application. When creating a view at position (0,0), the received motion
> events refer to the position within the window.

> BTW, the easiest way to see what input events you receive is to print
> each event. You can pass an Input::Event directly to the 'log' function.

> The wm (specifically the layouter) reports the window layout (including
> pixel positions for each window) as "window_layout" report. This report
> is normally consumed only by the decorator. By reflecting this report as
> a ROM (using report_rom) to your application, you can make the
> application aware of the complete layout if you want so. You may have a
> look at [1] to see the interplay of the window-management components
> (wm, layouter, decorator).


Thanks . I sorted it .. turned out to be a misunderstandng from my side.
Can I hide the system mouse pointer?

Another issue:
I don't know if anyone knows about this but ( long shot :-) ),
I am relying on the imx8 message unit (MU). I have been using polling 
against it, but now I need interrupts. But I can't get it to work. I am 
trying to enable it on CPUB side. no effect. So I tried it in Genode CPUA 
(Core 0) and after setting up interrupt in the MU chip I got interrupts 
from the cpu. So the qeustion is: Is it only possible to set it on Core 0 
and if so , can I route it to Core 1 in Genode. I have been looking in the 
gicv3 code and it seems like it only does core 0. I have also tried to 
enable it in genode and after that setting affinity on the second core ( 
from the second core). No effect. Interresting enough is that I can enable 
SoC timer and get it to interrupt core 1 ( not setting anything in Genode 
/ Core 0).

Michael

___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users


Re: Getting screen coordinate of a window

2024-01-23 Thread Norman Feske

Hi Michael,


Can I get screen coordinates of a window? I would like to be able to
caputure absolute mouse events and convert them to the window coordinate
system. I don't want to have relative mouse movement like I see in many
examples. In my context it doesn't work very well.

BTW the handle_relative_motion never seems to return anything. Is there a
configuration that I need? Would be terific if I could by some function
get window internal coordinates, but handle_relative_motion might not be
something for that?


both the nitpicker GUI server as well as the wm deliver only absolute 
motion events. Events delivered by nitpicker refer to the upper-left 
corner of the screen. Events delivered by the wm "virtualize" this 
upper-left corner so that the real window position is not exposed to the 
application. When creating a view at position (0,0), the received motion 
events refer to the position within the window.


BTW, the easiest way to see what input events you receive is to print 
each event. You can pass an Input::Event directly to the 'log' function.


The wm (specifically the layouter) reports the window layout (including 
pixel positions for each window) as "window_layout" report. This report 
is normally consumed only by the decorator. By reflecting this report as 
a ROM (using report_rom) to your application, you can make the 
application aware of the complete layout if you want so. You may have a 
look at [1] to see the interplay of the window-management components 
(wm, layouter, decorator).


[1] 
https://github.com/genodelabs/genode/blob/master/repos/gems/recipes/raw/motif_wm/wm.config


Cheers
Norman

--
Dr.-Ing. Norman Feske
Genode Labs

https://www.genode-labs.com · https://genode.org

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth


___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users


Re: Getting screen coordinate of a window

2024-01-22 Thread Christian Helmuth
Hello Michael,

On Mon, Jan 22, 2024 at 01:52:19 CET, Michael Grunditz wrote:
> > I also want to know if there are routines better suited  than memcpy for
> > ploting large buffers?
> 
> To follow up the memcpy issue .. with Genode::memcpy I get about 5 fps. 
> But in this very even and nice situation some neon code made it 60fps.

Our components use a simple blit library with implementations for
several ISAs to push pixels to the framebuffer.

  #include 

  LIBS += blit

  repos/os/src/test/fb_bench (example use case)

Regards
-- 
Christian Helmuth
Genode Labs

https://www.genode-labs.com/ · https://genode.org/
https://floss.social/@genode · https://genodians.org/

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth

___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users


Re: Getting screen coordinate of a window

2024-01-21 Thread Michael Grunditz
In message <7d6a5e265b.mickenx@armx6>
  Michael Grunditz  wrote:

> Hello!

> Can I get screen coordinates of a window? I would like to be able to
> caputure absolute mouse events and convert them to the window coordinate
> system. I don't want to have relative mouse movement like I see in many
> examples. In my context it doesn't work very well.

> BTW the handle_relative_motion never seems to return anything. Is there a
> configuration that I need? Would be terific if I could by some function
> get window internal coordinates, but handle_relative_motion might not be
> something for that?

> I also want to know if there are routines better suited  than memcpy for
> ploting large buffers? I have noticed that if I put something in a loop
> without a little delay the system crawls. Is the Gui not preemptive? As
> little as 10ns is enough.

> I plot 640x480x4. It acts a bit strange. Each second a frame takes less
> than 1/60 seconds. There are 3 frames that runs slower and back to quick.

> I have nano sleep that is based on that timing.

> /Michael

To follow up the memcpy issue .. with Genode::memcpy I get about 5 fps. 
But in this very even and nice situation some neon code made it 60fps.

Happy!

Michael

___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users


Getting screen coordinate of a window

2024-01-21 Thread Michael Grunditz
Hello!

Can I get screen coordinates of a window? I would like to be able to 
caputure absolute mouse events and convert them to the window coordinate 
system. I don't want to have relative mouse movement like I see in many 
examples. In my context it doesn't work very well.

BTW the handle_relative_motion never seems to return anything. Is there a 
configuration that I need? Would be terific if I could by some function 
get window internal coordinates, but handle_relative_motion might not be 
something for that?

I also want to know if there are routines better suited  than memcpy for 
ploting large buffers? I have noticed that if I put something in a loop 
without a little delay the system crawls. Is the Gui not preemptive? As 
little as 10ns is enough.

I plot 640x480x4. It acts a bit strange. Each second a frame takes less 
than 1/60 seconds. There are 3 frames that runs slower and back to quick.

I have nano sleep that is based on that timing.

/Michael


___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users