Re: framebuffer refresh rate and geometry

2022-04-12 Thread RVP

On Mon, 11 Apr 2022, Emmanuel Dreyfus wrote:


When the kernel initialize a framebuffer, the signal ouput changes a bit
fro mwhat is inherited from the BIOS. I face the situation where the
display looses the signal, and I suspect this is related to the refresh
rate.



OK, I'm able to get a usable UEFI console (intelfb) with the hack below
(starting X, however, immediately locks up the system):

```
diff -urN a/sys/external/bsd/drm2/dist/drm/i915/display/intel_lvds.c 
b/sys/external/bsd/drm2/dist/drm/i915/display/intel_lvds.c
--- a/sys/external/bsd/drm2/dist/drm/i915/display/intel_lvds.c  2021-12-18 
23:45:30.0 +
+++ b/sys/external/bsd/drm2/dist/drm/i915/display/intel_lvds.c  2022-04-12 
10:28:48.162488466 +
@@ -962,11 +962,6 @@
if (fixed_mode)
goto out;

-   /* Failed to get EDID, what about VBT? */
-   fixed_mode = intel_panel_vbt_fixed_mode(intel_connector);
-   if (fixed_mode)
-   goto out;
-
/*
 * If we didn't get EDID, try checking if the panel is already turned
 * on.  If so, assume that whatever is currently programmed is the
@@ -977,8 +972,12 @@
DRM_DEBUG_KMS("using current (BIOS) mode: ");
drm_mode_debug_printmodeline(fixed_mode);
fixed_mode->type |= DRM_MODE_TYPE_PREFERRED;
+   goto out;
}

+   /* Failed to get current mode, what about VBT? */
+   fixed_mode = intel_panel_vbt_fixed_mode(intel_connector);
+
/* If we still don't have a mode after all that, give up. */
if (!fixed_mode)
goto failed;
```

Going by the kernel messages, on 9.2, the old DRM fails to find a VBT:

```
kern info: [drm] failed to find VBIOS tables
i915drmkms0: interrupting at ioapic0 pin 16 (i915drmkms0)
intelfb0 at i915drmkms0
intelfb0: framebuffer at 0xd700687fb000, size 1366x768, depth 32, 
stride 5504

kern error: 
[drm:(/usr/src/sys/external/bsd/drm2/dist/drm/i915/intel_fifo_underrun.c:230)cpt_set_fifo_underrun_reporting]
 *ERROR* uncleared pch fifo underrun on pch transcoder A
kern error: 
[drm:(/usr/src/sys/external/bsd/drm2/dist/drm/i915/intel_fifo_underrun.c:381)intel_pch_fifo_underrun_irq_handler]
 *ERROR* PCH transcoder A FIFO underrun
wsdisplay0 at intelfb0 kbdmux 1: console (default, vt100 emulation), using 
wskbd0
```

but, somehow still picks the correct native mode (1366x768) and everything 
is fine. The new DRM code, _does_ seem to find a VBT, but picks a 
non-native resolution (1024x768) in UEFI mode and the display gets messed 
up. In CSM mode, 1366x768 is correctly picked from the VBT.


I'll try to chase this down further when I have the time, but, somebody who
_knows_ this stuff would obviously make quicker progress.

-RVP


Emulating missing linux syscalls

2022-04-12 Thread Ahmed bahloul
Hello,

I have submitted my draft proposal on gsoc platform. Could you review it
and let me know what you think?

Thank you in advance
Ahmed Ehab


Re: Emulating missing linux syscalls

2022-04-12 Thread Christos Zoulas
In article , Joerg Sonnenberger   wrote:
>Am Tue, Apr 12, 2022 at 12:29:21PM - schrieb Christos Zoulas:
>> In article
>,
>> Piyush Sachdeva   wrote:
>> >-=-=-=-=-=-
>> >
>> >Dear Stephen Borrill,
>> >My name is Piyush, and I was looking into the
>> >'Emulating missing Linux syscalls' project hoping to contribute
>> >to this year's GSoC.
>> >
>> >I wanted to be sure of a few basic things before I go ahead:
>> >- linux binaries are found in- src/sys/compat/linux
>> >- particular implementation in - src/sys/compat/linux/common
>> >- a few architecture-specific implementations in-
>> >  src/sys/compat/linux/arch/.
>> >- The src/sys/compat/linux/arch//linux_syscalls.c file
>> >   lists of system calls, and states if a particular syscall is present or
>> >not.
>> >
>> >I was planning to work on the 'sendfile()' syscall, which I believe
>> >is unimplemented for amd64 and a few other architectures as well.
>> >
>> >Considering the above points, I was hoping you could point me in
>> >the right direction for this project. Hope to hear from you soon.
>> 
>> I would look into porting the FreeBSD implementation of sendfile to NetBSD.
>
>sendfile(2) for Linux compat can be emulated in the kernel without
>backing. That said, a real splice(2) or even splicev(2) would be really
>nice to have. But that's a different project and arguable, a potentially
>more generally useful one, too.


Yes, splice is more general (as opposed to send a file to a socket), but I
think splice has limitations too (one of the fds needs to be a pipe).
Is that true only for linux?

christos



Re: Emulating missing linux syscalls

2022-04-12 Thread Joerg Sonnenberger
Am Tue, Apr 12, 2022 at 12:29:21PM - schrieb Christos Zoulas:
> In article 
> ,
> Piyush Sachdeva   wrote:
> >-=-=-=-=-=-
> >
> >Dear Stephen Borrill,
> >My name is Piyush, and I was looking into the
> >'Emulating missing Linux syscalls' project hoping to contribute
> >to this year's GSoC.
> >
> >I wanted to be sure of a few basic things before I go ahead:
> >- linux binaries are found in- src/sys/compat/linux
> >- particular implementation in - src/sys/compat/linux/common
> >- a few architecture-specific implementations in-
> >  src/sys/compat/linux/arch/.
> >- The src/sys/compat/linux/arch//linux_syscalls.c file
> >   lists of system calls, and states if a particular syscall is present or
> >not.
> >
> >I was planning to work on the 'sendfile()' syscall, which I believe
> >is unimplemented for amd64 and a few other architectures as well.
> >
> >Considering the above points, I was hoping you could point me in
> >the right direction for this project. Hope to hear from you soon.
> 
> I would look into porting the FreeBSD implementation of sendfile to NetBSD.

sendfile(2) for Linux compat can be emulated in the kernel without
backing. That said, a real splice(2) or even splicev(2) would be really
nice to have. But that's a different project and arguable, a potentially
more generally useful one, too.

Joerg


Re: Emulating missing linux syscalls

2022-04-12 Thread Christos Zoulas
In article 
,
Piyush Sachdeva   wrote:
>-=-=-=-=-=-
>
>Dear Stephen Borrill,
>My name is Piyush, and I was looking into the
>'Emulating missing Linux syscalls' project hoping to contribute
>to this year's GSoC.
>
>I wanted to be sure of a few basic things before I go ahead:
>- linux binaries are found in- src/sys/compat/linux
>- particular implementation in - src/sys/compat/linux/common
>- a few architecture-specific implementations in-
>  src/sys/compat/linux/arch/.
>- The src/sys/compat/linux/arch//linux_syscalls.c file
>   lists of system calls, and states if a particular syscall is present or
>not.
>
>I was planning to work on the 'sendfile()' syscall, which I believe
>is unimplemented for amd64 and a few other architectures as well.
>
>Considering the above points, I was hoping you could point me in
>the right direction for this project. Hope to hear from you soon.

I would look into porting the FreeBSD implementation of sendfile to NetBSD.

christos



Re: framebuffer refresh rate and geometry

2022-04-12 Thread RVP

On Tue, 12 Apr 2022, Michael van Elst wrote:



wsconsctl learned about the edid attribute in -current.

Either a pullup is necessary, or you can try with the -current binary.



Yah--this is with a recent -HEAD. On older versions I used the ioctl
directly. No joy even in CSM mode, which is the only way DRM runs
properly on my HW.

-RVP