Hardware graphics acceleration port idea

There is also OpenCL support to consider that may not impede getting graphics working too much. Also I think a long time ago it was mentioned that perhaps one of the video acceleration APIs could be hooked up on Haiku. But yeah one thing at a time I guess… I thinking OpenCL could actually occur before graphics acceleration though since there is less going on there.

If either of you needs hardware let me know.

1 Like

Some time ago I tried to get multiple displays working with a supported Radeon card. I couldn’t get it to work. It may require some extra work.

It worked last time I booted Haiku on my 2003 machine. You need one of the old Radeons (7000/VE or 9250) from 20 years ago. The new radeon_hd driver does not support multiple displays (yet).

1 Like

Is it possible to make at least experimental accelerant API to enumerate displays and getting front buffer of specific display? I can try to integrate it to app_server and Interface Kit.

Related tickets: https://dev.haiku-os.org/ticket/10486, https://dev.haiku-os.org/ticket/8612.

2 Likes

The starting point is https://review.haiku-os.org/c/haiku/+/329 there are open questions in the comments.

And also the hacks from the old Radeon driver with RADEON_MODE_MULTIMON_REQUEST/REPLY (https://git.haiku-os.org/haiku/tree/headers/private/graphics/radeon/accelerant_ext.h) which was done this way because the driver was also used on BeOS and changing the hooks there wasn’t possible.

5 Likes

Love it… another if I can help with any hardware.

1 Like

I have a variation of the Radeon 9800 in my Tyan Thunder 2 ATX these days… I should give it a go also.

1 Like

If hardware testing for anything is needed I have a massive collection of graphics cards from the mid 90s up of about every company that was worth mentioning, and even some that are rather fringe. I have some strange obsession with collecting interesting and old graphics cards, so far I have about 4 large boxes full :neutral_face:

9 Likes

Hi,

Please remember that the nVidia driver I wrote, and also the Matrox driver do support dualhead modes: these use Mark Watson’s preference app, but for the nVidia driver I also added partial support for Thomas his method (Thomas and I had long night-time conversations at BeGeistert back in the day :wink: )

The nVidia driver supports TNT1 upto/including GeForce 7900 or so… And of course I have a lot of them still a few meters away from where I am sitting writing this message :slight_smile:
Bye!

Oh, PS:
http://www.rudolfs-place.nl/BeOS/BeOS.html

8 Likes

Think it ran pretty well on BeOS/ZETA back then :slight_smile:

6 Likes

I found @kallisti5 DRM port attempt: https://gitlab.com/kallisti5/haikugpu. I tried to compile but it failed for both x86 and x86_64:

> scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
Install directory: "/Haiku/data/packages/linux-5.5.2/include/asm-generic" as "target-x86_64/include/asm-generic"
Install directory: "/Haiku/data/packages/linux-5.5.2/include/video" as "target-x86_64/include/video"
gcc -o /Haiku/data/packages/linux-5.5.2/drivers/gpu/drm/cirrus/cirrus.os -c -fPIC -Isrc -Iinclude -I/Haiku/data/packages/linux-5.5.2/arch/x86/include -I/Haiku/data/packages/linux-5.5.2/arch/x86/include/uapi -Itarget-x86_64/include -Isrc/include /Haiku/data/packages/linux-5.5.2/drivers/gpu/drm/cirrus/cirrus.c
In file included from /Haiku/data/packages/linux-5.5.2/arch/x86/include/asm/vga.h:11,
                 from target-x86_64/include/video/vga.h:22,
                 from /Haiku/data/packages/linux-5.5.2/drivers/gpu/drm/cirrus/cirrus.c:24:
/Haiku/data/packages/linux-5.5.2/arch/x86/include/asm/set_memory.h:50:31: warning: 'struct page' declared inside parameter list will not be visible outside of this definition or declaration
 int set_pages_array_uc(struct page **pages, int addrinarray);
                               ^~~~
/Haiku/data/packages/linux-5.5.2/arch/x86/include/asm/set_memory.h:51:31: warning: 'struct page' declared inside parameter list will not be visible outside of this definition or declaration
 int set_pages_array_wc(struct page **pages, int addrinarray);
                               ^~~~
/Haiku/data/packages/linux-5.5.2/arch/x86/include/asm/set_memory.h:52:31: warning: 'struct page' declared inside parameter list will not be visible outside of this definition or declaration
 int set_pages_array_wt(struct page **pages, int addrinarray);
                               ^~~~
/Haiku/data/packages/linux-5.5.2/arch/x86/include/asm/set_memory.h:53:31: warning: 'struct page' declared inside parameter list will not be visible outside of this definition or declaration
 int set_pages_array_wb(struct page **pages, int addrinarray);
                               ^~~~
/Haiku/data/packages/linux-5.5.2/arch/x86/include/asm/set_memory.h:75:25: warning: 'struct page' declared inside parameter list will not be visible outside of this definition or declaration
 int set_pages_uc(struct page *page, int numpages);
                         ^~~~
/Haiku/data/packages/linux-5.5.2/arch/x86/include/asm/set_memory.h:76:25: warning: 'struct page' declared inside parameter list will not be visible outside of this definition or declaration
 int set_pages_wb(struct page *page, int numpages);
                         ^~~~
/Haiku/data/packages/linux-5.5.2/arch/x86/include/asm/set_memory.h:77:25: warning: 'struct page' declared inside parameter list will not be visible outside of this definition or declaration
 int set_pages_ro(struct page *page, int numpages);
                         ^~~~
/Haiku/data/packages/linux-5.5.2/arch/x86/include/asm/set_memory.h:78:25: warning: 'struct page' declared inside parameter list will not be visible outside of this definition or declaration
 int set_pages_rw(struct page *page, int numpages);
                         ^~~~
/Haiku/data/packages/linux-5.5.2/arch/x86/include/asm/set_memory.h:80:43: warning: 'struct page' declared inside parameter list will not be visible outside of this definition or declaration
 int set_direct_map_invalid_noflush(struct page *page);
                                           ^~~~
/Haiku/data/packages/linux-5.5.2/arch/x86/include/asm/set_memory.h:81:43: warning: 'struct page' declared inside parameter list will not be visible outside of this definition or declaration
 int set_direct_map_default_noflush(struct page *page);
                                           ^~~~
In file included from /Haiku/data/packages/linux-5.5.2/drivers/gpu/drm/cirrus/cirrus.c:24:
target-x86_64/include/video/vga.h:183:15: error: expected ':', ',', ';', '}' or '__attribute__' before ' token
  void __iomem *vgabase; /* mmio base, if supported      */
               ^
target-x86_64/include/video/vga.h: In function 'vga_io_r':
target-x86_64/include/video/vga.h:204:9: warning: implicit declaration of function 'inb_p' [-Wimplicit-function-declaration]
  return inb_p(port);
         ^~~~~
target-x86_64/include/video/vga.h: In function 'vga_io_w':
target-x86_64/include/video/vga.h:209:2: warning: implicit declaration of function 'outb_p' [-Wimplicit-function-declaration]
  outb_p(val, port);
  ^~~~~~
target-x86_64/include/video/vga.h: In function 'vga_io_w_fast':
target-x86_64/include/video/vga.h:215:2: warning: implicit declaration of function 'outw' [-Wimplicit-function-declaration]
  outw(VGA_OUT16VAL (val, reg), port);
  ^~~~
target-x86_64/include/video/vga.h: At top level:
target-x86_64/include/video/vga.h:218:52: error: expected ';', ',' or ')' before '*' token
 static inline unsigned char vga_mm_r (void __iomem *regbase, unsigned short port)
                                                    ^
target-x86_64/include/video/vga.h:223:43: error: expected ';', ',' or ')' before '*' token
 static inline void vga_mm_w (void __iomem *regbase, unsigned short port, unsigned char val)
                                           ^
target-x86_64/include/video/vga.h:228:48: error: expected ';', ',' or ')' before '*' token
 static inline void vga_mm_w_fast (void __iomem *regbase, unsigned short port,
                                                ^
target-x86_64/include/video/vga.h:234:49: error: expected ';', ',' or ')' before '*' token
 static inline unsigned char vga_r (void __iomem *regbase, unsigned short port)
                                                 ^
target-x86_64/include/video/vga.h:242:40: error: expected ';', ',' or ')' before '*' token
 static inline void vga_w (void __iomem *regbase, unsigned short port, unsigned char val)
                                        ^
target-x86_64/include/video/vga.h:251:45: error: expected ';', ',' or ')' before '*' token
 static inline void vga_w_fast (void __iomem *regbase, unsigned short port,
                                             ^
target-x86_64/include/video/vga.h:265:52: error: expected ';', ',' or ')' before '*' token
 static inline unsigned char vga_rcrt (void __iomem *regbase, unsigned char reg)
                                                    ^
target-x86_64/include/video/vga.h:271:43: error: expected ';', ',' or ')' before '*' token
 static inline void vga_wcrt (void __iomem *regbase, unsigned char reg, unsigned char val)
                                           ^
target-x86_64/include/video/vga.h:297:55: error: expected ';', ',' or ')' before '*' token
 static inline unsigned char vga_mm_rcrt (void __iomem *regbase, unsigned char reg)
                                                       ^
target-x86_64/include/video/vga.h:303:46: error: expected ';', ',' or ')' before '*' token
 static inline void vga_mm_wcrt (void __iomem *regbase, unsigned char reg, unsigned char val)
                                              ^
target-x86_64/include/video/vga.h:318:52: error: expected ';', ',' or ')' before '*' token
 static inline unsigned char vga_rseq (void __iomem *regbase, unsigned char reg)
                                                    ^
target-x86_64/include/video/vga.h:324:43: error: expected ';', ',' or ')' before '*' token
 static inline void vga_wseq (void __iomem *regbase, unsigned char reg, unsigned char val)
                                           ^
target-x86_64/include/video/vga.h:350:55: error: expected ';', ',' or ')' before '*' token
 static inline unsigned char vga_mm_rseq (void __iomem *regbase, unsigned char reg)
                                                       ^
target-x86_64/include/video/vga.h:356:46: error: expected ';', ',' or ')' before '*' token
 static inline void vga_mm_wseq (void __iomem *regbase, unsigned char reg, unsigned char val)
                                              ^
target-x86_64/include/video/vga.h:370:52: error: expected ';', ',' or ')' before '*' token
 static inline unsigned char vga_rgfx (void __iomem *regbase, unsigned char reg)
                                                    ^
target-x86_64/include/video/vga.h:376:43: error: expected ';', ',' or ')' before '*' token
 static inline void vga_wgfx (void __iomem *regbase, unsigned char reg, unsigned char val)
                                           ^
target-x86_64/include/video/vga.h:402:55: error: expected ';', ',' or ')' before '*' token
 static inline unsigned char vga_mm_rgfx (void __iomem *regbase, unsigned char reg)
                                                       ^
target-x86_64/include/video/vga.h:408:46: error: expected ';', ',' or ')' before '*' token
 static inline void vga_mm_wgfx (void __iomem *regbase, unsigned char reg, unsigned char val)
                                              ^
target-x86_64/include/video/vga.h:423:53: error: expected ';', ',' or ')' before '*' token
 static inline unsigned char vga_rattr (void __iomem *regbase, unsigned char reg)
                                                     ^
target-x86_64/include/video/vga.h:429:44: error: expected ';', ',' or ')' before '*' token
 static inline void vga_wattr (void __iomem *regbase, unsigned char reg, unsigned char val)
                                            ^
target-x86_64/include/video/vga.h:447:56: error: expected ';', ',' or ')' before '*' token
 static inline unsigned char vga_mm_rattr (void __iomem *regbase, unsigned char reg)
                                                        ^
target-x86_64/include/video/vga.h:453:47: error: expected ';', ',' or ')' before '*' token
 static inline void vga_mm_wattr (void __iomem *regbase, unsigned char reg, unsigned char val)
                                               ^
/Haiku/data/packages/linux-5.5.2/drivers/gpu/drm/cirrus/cirrus.c:26:10: fatal error: drm/drm_atomic_helper.h: No such file or directory
 #include <drm/drm_atomic_helper.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
scons: *** [/Haiku/data/packages/linux-5.5.2/drivers/gpu/drm/cirrus/cirrus.os] Error 1
scons: building terminated because of errors.

What Linux version and target architecture (x86 or x86_64) was used?

1 Like

Yes, it doesn’t compile, it’s a hack of a first attempt with virtually nothing implemented and I think he since abandoned it; we were discussing this together as he was working on it.

Post in another thread about proposed architecture: Flat Decorator and ControlLook - #115 by X512.

5 Likes

How does this proposal utilize Mesa and/or the KMS-DRM driver stack?

I don’t think it is feasible to write graphics drivers that utilize neither of the two. Even if we can somehow write our own kernel-level drivers, we are simply going to have to make use of Mesa, and there is no way around that.

it’s probably ok to break beos compatibility, with obsolete rare hardware

2 Likes

It can be done as wrapper over GBM and DRM-KMS ioctls for screen BufferConsumer.

2 Likes

This DRM-KMS will be ports from fBSD?

Initial implementation can be done even without hardware acceleration driver. It is possible to implement software backend addon and software compositor. Video card driver should provide frontbuffer swapping and retrace semaphore. It allows to implement buffer passing, synchronization mechanisms and update regions management (it is done differently for buffer swapping based rendering, see this article). As some benefit it would give tearing-free rendering.

8 Likes

apply with haiku foundation for a contract to tackle it, you seem to have the skills required.

Personally, I think it’d be awesome if you brought over the AMD driver. AMD might even help.

4 Likes

Just a quick interjection here: if OpenGL acceleration is successfully implemented, a driver for NVIDIA GPUs such as the Quadro FX 3700M (i.e., from 2009 onward) would be nice as well. My ThinkPad (primary computer) has a Quadro FX 3700M, and was manufactured just before the advent of Intel iGPUs, so at the moment I’ve got no choice but to use VESA under Haiku, with no hardware acceleration. Not the best situation, since I mostly only use that machine for gaming. Just a thought; I realize that it may be difficult to actually make it happen. I don’t have the necessary skill to attempt it myself, so I figured it was worth asking about.