SlideShare a Scribd company logo
Gallium3D - Mesa’s New Driver Model


                                             Chia-I Wu

                                          olvaffe@gmail.com


                                          Mar 27, 2011




Chia-I Wu (olvaffe@gmail.com)       Gallium3D - Mesa’s New Driver Model   Mar 27, 2011   1 / 24
Agenda


Who Am I?




   main developer of Mesa EGL stack
   Android(-x86) port of Mesa
   experiences in OpenGL stacks




  Chia-I Wu (olvaffe@gmail.com)   Gallium3D - Mesa’s New Driver Model   Mar 27, 2011   2 / 24
Agenda


Who Am I?




   main developer of Mesa EGL stack
   Android(-x86) port of Mesa
   experiences in OpenGL stacks

   a member of 0xlab




  Chia-I Wu (olvaffe@gmail.com)   Gallium3D - Mesa’s New Driver Model   Mar 27, 2011   2 / 24
Agenda


Agenda




   OpenGL and Linux: DRI
   classic and Gallium3D driver models
   how does it make a developer happy




  Chia-I Wu (olvaffe@gmail.com)   Gallium3D - Mesa’s New Driver Model   Mar 27, 2011   3 / 24
OpenGL and Linux


Mesa v.s. Proprietary Drivers




Isn’t this the case?


                                                       Mesa         Proprietary
                                      stability         .               v
                                   performance          .               v
                                    feature set         .               v
                                      it’s free         v                .




   Chia-I Wu (olvaffe@gmail.com)         Gallium3D - Mesa’s New Driver Model      Mar 27, 2011   4 / 24
OpenGL and Linux


Not Always

                            Figure: nouveau v.s. nVidia binary driver (phronix)




  Chia-I Wu (olvaffe@gmail.com)          Gallium3D - Mesa’s New Driver Model      Mar 27, 2011   5 / 24
OpenGL and Linux


People




                         BIG TEAMS / BIG BUDGET




  Chia-I Wu (olvaffe@gmail.com)    Gallium3D - Mesa’s New Driver Model   Mar 27, 2011   6 / 24
OpenGL and Linux


DRI



Direct Rendering Infrastructure, DRI




      direct rendering




   Chia-I Wu (olvaffe@gmail.com)    Gallium3D - Mesa’s New Driver Model   Mar 27, 2011   7 / 24
OpenGL and Linux


DRI



Direct Rendering Infrastructure, DRI




      direct rendering
      core X rendering
      indirect rendering




   Chia-I Wu (olvaffe@gmail.com)    Gallium3D - Mesa’s New Driver Model   Mar 27, 2011   7 / 24
OpenGL and Linux


DRI Components




  Chia-I Wu (olvaffe@gmail.com)    Gallium3D - Mesa’s New Driver Model   Mar 27, 2011   8 / 24
OpenGL and Linux


DRI Components




   <hw> dri.so is the DRI or 3D driver
   <hw> drv.so is the DDX or 2D driver
   <hw>.ko is the DRM kernel module
   libdrm <hw>.so is the user space library for the DRM module
   GLX and DRI2 are X11 protocols


  Chia-I Wu (olvaffe@gmail.com)    Gallium3D - Mesa’s New Driver Model   Mar 27, 2011   8 / 24
OpenGL and Linux


They are all complex




    DRM driver for buffer management, mode setting, ... (radeon has ∼70k LoC)
    DDX driver for 2D operations, video, mode setting, ... (radeon has ∼100k LoC)
    DRI driver for OpenGL (radeon has ∼90k LoC)




   Chia-I Wu (olvaffe@gmail.com)    Gallium3D - Mesa’s New Driver Model   Mar 27, 2011   9 / 24
OpenGL and Linux


OpenGL under Mesa Classic Driver Model




                       libGL.so            <hw>_dri.so                     libdrm_<hw>.so




 DRI driver interface              Mesa common code                           HW code

In the classic model,
    there is common code that checks the arguments of an OpenGL call and updates
    internal states
    it then calls into the HW code using the function table implemented there
There is an almost one-to-one mapping between OpenGL API and the function table that
the HW code implements.




   Chia-I Wu (olvaffe@gmail.com)     Gallium3D - Mesa’s New Driver Model             Mar 27, 2011   10 / 24
OpenGL and Linux


Dissection of the DRI driver




                       libGL.so            <hw>_dri.so                     libdrm_<hw>.so




 DRI driver interface              Mesa common code                           HW code

    OS dependent: the HW code
    display server dependent: none
    OpenGL dependent: the common and HW code




   Chia-I Wu (olvaffe@gmail.com)     Gallium3D - Mesa’s New Driver Model             Mar 27, 2011   11 / 24
OpenGL and Linux


Problems with the Classic Model




The problems with the classic model are
    it is OpenGL(ES) only; even the hardware can support OpenVG, OpenCL, ...
    the driver uses OpenGL data types and objects
    the driver must handle the differences between OpenGL and the hardware
    an implementation issue instead of a design issue in view of the DRI architecture




   Chia-I Wu (olvaffe@gmail.com)    Gallium3D - Mesa’s New Driver Model   Mar 27, 2011   12 / 24
Gallium3D


Ideal Model




  Chia-I Wu (olvaffe@gmail.com)   Gallium3D - Mesa’s New Driver Model   Mar 27, 2011   13 / 24
Gallium3D


Gallium3D




                    libGL.so             <hw>_dri.so                    libdrm_<hw>.so




     DRI state tracker
                                           pipe driver                    pipe winsys
  OpenGL state tracker


   OS dependent: the pipe winsys
   display server dependent: none
   OpenGL dependent: OpenGL state tracker




  Chia-I Wu (olvaffe@gmail.com)   Gallium3D - Mesa’s New Driver Model             Mar 27, 2011   14 / 24
Gallium3D


Gallium3D




                    libGL.so             <hw>_dri.so                    libdrm_<hw>.so




     DRI state tracker
                                           pipe driver                    pipe winsys
  OpenGL state tracker


   OS dependent: the pipe winsys
   display server dependent: none
   OpenGL dependent: OpenGL state tracker
   The pipe driver is highly protable and has a well-defined interface!




  Chia-I Wu (olvaffe@gmail.com)   Gallium3D - Mesa’s New Driver Model             Mar 27, 2011   14 / 24
Gallium3D


Classic Model to Gallium3D Model


                         libGL.so          <hw>_dri.so                    libdrm_<hw>.so




         DRI driver interface         Mesa common code                         HW code




    DRI state tracker
                                                              pipe driver         pipe winsys
 OpenGL state tracker

This is a non-trivial process
     DRI and OpenGL state trackers are written once and shared
     the pipe driver and winsys must be written for each HW
     new drivers should adopt the Gallium3D model from beginning


   Chia-I Wu (olvaffe@gmail.com)    Gallium3D - Mesa’s New Driver Model               Mar 27, 2011   15 / 24
Gallium3D


Gallium3D: examples

  libEGL.so         egl_dri2.so           <hw>_dri.so                    libdrm_<hw>.so




      DRI state tracker
                                            pipe driver                    pipe winsys
  OpenVG state tracker



                  libOpenCL.so            <hw>_dri.so                    libdrm_<hw>.so




      DRI state tracker
                                            pipe driver                    pipe winsys
  OpenCL state tracker

(You can also have all OpenGL, OpenVG, and OpenCL state trackers inside a single DRI
driver)

   Chia-I Wu (olvaffe@gmail.com)   Gallium3D - Mesa’s New Driver Model             Mar 27, 2011   16 / 24
Gallium3D


Gallium3D: even for DDX




                       Xorg          <hw>_drv.so (DDX)                   libdrm_<hw>.so




     DDX state tracker                      pipe driver                    pipe winsys

A modern DDX driver is more than a 2D driver
    EXA/UXA
    Xrender
    video decoding
    mode setting KMS




   Chia-I Wu (olvaffe@gmail.com)   Gallium3D - Mesa’s New Driver Model             Mar 27, 2011   17 / 24
Gallium3D


Gallium3D: SVGA




VMWare has a virtual GPU named SVGA. The aquisition of Tungsten Graphics gives
    vmwgfx.ko DRM module
    Gallium3D based DRI driver
    Gallium3D based DDX driver
    Gallium3D based D3D9 driver (D3D9 state tracker + Windows winsys)




   Chia-I Wu (olvaffe@gmail.com)   Gallium3D - Mesa’s New Driver Model   Mar 27, 2011   18 / 24
Developers


Gallium3D core




Gallium3D core consists of
    two interfaces: struct pipe screen and struct pipe context
    helper functions for format conversions, buffer management, vertex processing, and
    etc.
    wrappers of OS or compiler dependent functions, such as threads, timing, I/O
Pipe drivers implement struct pipe screen and struct pipe context interfaces.
State trackers are users of the interfaces.




   Chia-I Wu (olvaffe@gmail.com)   Gallium3D - Mesa’s New Driver Model   Mar 27, 2011   19 / 24
Developers


struct pipe screen




The pipe screen is an abstraction of the adapter. It is used for
    querying adapter capabilities/limitations
    creating resources
    fencing
    and other misc operations




   Chia-I Wu (olvaffe@gmail.com)   Gallium3D - Mesa’s New Driver Model   Mar 27, 2011   20 / 24
Developers


struct pipe context

The pipe context is an abstraction of the graphics pipeline (and some misc operations)

   vertex buffers                    vertex fetcher


                                    vertex shader


                                   geometry shader                         stream output buffers

    textures and
  constant buffers                      rasterizer


                                   fragment shader


                                   per-fragment ops                        color and depth buffers


   Chia-I Wu (olvaffe@gmail.com)     Gallium3D - Mesa’s New Driver Model               Mar 27, 2011   21 / 24
Developers


Pseudo Code




/∗ c r e a t e t h e p i p e s c r e e n ∗/
s t r u c t p i p e s c r e e n ∗ s c r e e n = o p e n h w d e v i c e ( dev name ) ;

/∗ c r e a t e a p i p e c o n t e x t ∗/
s t r u c t p i p e s c r e e n ∗ p i p e = s c r e e n −>c o n t e x t c r e a t e ( / ∗ . . . ∗ / ) ;
struct pipe resource ∗ res ;

/∗ c r e a t e a r e s o u r c e from t h e s c r e e n ∗/
r e s = s c r e e n −>r e s o u r c e c r e a t e ( / ∗ . . . ∗ / ) ;

/∗ s e t t h e r e s o u r c e a s t h e f r a m e b u f f e r ∗/
p i p e −>s e t f r a m e b u f f e r s t a t e ( / ∗ . . . ∗ / ) ;




    Chia-I Wu (olvaffe@gmail.com)        Gallium3D - Mesa’s New Driver Model                Mar 27, 2011   22 / 24
Developers


It is easier




Gallium3D driver model
    has well-defined interfaces and types
    is close to the hardware
    has reusable state trackers
    has lots of helper functions
    supports pipe screen/context wrapping: trace, rbug, galahad




   Chia-I Wu (olvaffe@gmail.com)   Gallium3D - Mesa’s New Driver Model   Mar 27, 2011   23 / 24
Q&A


Q&A




Questions?




   Chia-I Wu (olvaffe@gmail.com)   Gallium3D - Mesa’s New Driver Model   Mar 27, 2011   24 / 24

More Related Content

PDF
Jagan Teki - U-boot from scratch
PPT
Learning AOSP - Android Booting Process
PPT
Learning AOSP - Android Linux Device Driver
PDF
Android 电源管理 power_management_(英文版)
PPTX
Android Booting Sequence
PDF
Study on Android Emulator
PDF
Embedded Android : System Development - Part II (HAL)
PDF
Csw2017 bazhaniuk exploring_yoursystemdeeper_updated
Jagan Teki - U-boot from scratch
Learning AOSP - Android Booting Process
Learning AOSP - Android Linux Device Driver
Android 电源管理 power_management_(英文版)
Android Booting Sequence
Study on Android Emulator
Embedded Android : System Development - Part II (HAL)
Csw2017 bazhaniuk exploring_yoursystemdeeper_updated

What's hot (20)

PDF
Embedded Android : System Development - Part I
PPTX
Android+init+process
PDF
Android IPC Mechanism
PDF
Understaing Android EGL
PDF
HKG18-116 - RAS Solutions for Arm64 Servers
PDF
Android Multimedia Framework
PPT
Googlechrome ppt
PDF
Device Tree for Dummies (ELC 2014)
PDF
BKK16-315 Graphics Stack Update
PDF
Attack modeling vs threat modelling
PPT
U Boot or Universal Bootloader
PPTX
Android service, aidl - day 1
PPTX
CloudFest US 2023 - Building a Connected Future for Your Business - Jan Loeff...
PDF
Embedded Android : System Development - Part IV
PDF
Audio Drivers
PPT
U boot porting guide for SoC
PPTX
Pentesting Android Applications
PPTX
UEFI Spec Version 2.4 Facilitates Secure Update
PDF
Deep Dive into the AOSP
Embedded Android : System Development - Part I
Android+init+process
Android IPC Mechanism
Understaing Android EGL
HKG18-116 - RAS Solutions for Arm64 Servers
Android Multimedia Framework
Googlechrome ppt
Device Tree for Dummies (ELC 2014)
BKK16-315 Graphics Stack Update
Attack modeling vs threat modelling
U Boot or Universal Bootloader
Android service, aidl - day 1
CloudFest US 2023 - Building a Connected Future for Your Business - Jan Loeff...
Embedded Android : System Development - Part IV
Audio Drivers
U boot porting guide for SoC
Pentesting Android Applications
UEFI Spec Version 2.4 Facilitates Secure Update
Deep Dive into the AOSP
Ad

Viewers also liked (7)

PPT
NVIDIA's OpenGL Functionality
PPT
OpenGL 3.2 and More
PDF
OpenGL NVIDIA Command-List: Approaching Zero Driver Overhead
PPT
OpenGL 4 for 2010
PPTX
OpenGL 4.5 Update for NVIDIA GPUs
PDF
Secret of Intel Management Engine by Igor Skochinsky
PPTX
Beyond porting
NVIDIA's OpenGL Functionality
OpenGL 3.2 and More
OpenGL NVIDIA Command-List: Approaching Zero Driver Overhead
OpenGL 4 for 2010
OpenGL 4.5 Update for NVIDIA GPUs
Secret of Intel Management Engine by Igor Skochinsky
Beyond porting
Ad

Similar to Gallium3D - Mesa's New Driver Model (20)

PDF
Introduction to Mesa. The Open-Source Graphics API Implementation Library (Ub...
PDF
[Ubucon Europe 2018] Introduction to mesa, the open-source graphics API imple...
PDF
Embedded Graphics Drivers in Mesa (ELCE 2019)
PDF
8 Years of Open Drivers, including the State of Vulkan in Mesa
PDF
Embedded Recipes 2019 - Making embedded graphics less special
PPTX
Graphics Libraries
PPTX
The next generation of GPU APIs for Game Engines
PDF
I965g
PPTX
Slideshare
PDF
GLX, DRI, and i965
PDF
Castle Game Engine and the joy of making and using a custom game engine
PDF
Mesa and Its Debugging, Вадим Шовкопляс
PPT
SIGGRAPH Asia 2008 Modern OpenGL
PDF
There is more to C
PDF
Mesa3D Unveiled: From glDrawArrays(...) to GPU Magic
PDF
About OpenGL and Vulkan interoperability (XDC 2020)
DOCX
Ha4 displaying 3 d polygon animations
PPTX
What is OpenGL ?
PPTX
Porting the Source Engine to Linux: Valve's Lessons Learned
ODP
Embedded Linux Multimedia
Introduction to Mesa. The Open-Source Graphics API Implementation Library (Ub...
[Ubucon Europe 2018] Introduction to mesa, the open-source graphics API imple...
Embedded Graphics Drivers in Mesa (ELCE 2019)
8 Years of Open Drivers, including the State of Vulkan in Mesa
Embedded Recipes 2019 - Making embedded graphics less special
Graphics Libraries
The next generation of GPU APIs for Game Engines
I965g
Slideshare
GLX, DRI, and i965
Castle Game Engine and the joy of making and using a custom game engine
Mesa and Its Debugging, Вадим Шовкопляс
SIGGRAPH Asia 2008 Modern OpenGL
There is more to C
Mesa3D Unveiled: From glDrawArrays(...) to GPU Magic
About OpenGL and Vulkan interoperability (XDC 2020)
Ha4 displaying 3 d polygon animations
What is OpenGL ?
Porting the Source Engine to Linux: Valve's Lessons Learned
Embedded Linux Multimedia

Gallium3D - Mesa's New Driver Model

  • 1. Gallium3D - Mesa’s New Driver Model Chia-I Wu olvaffe@gmail.com Mar 27, 2011 Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 1 / 24
  • 2. Agenda Who Am I? main developer of Mesa EGL stack Android(-x86) port of Mesa experiences in OpenGL stacks Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 2 / 24
  • 3. Agenda Who Am I? main developer of Mesa EGL stack Android(-x86) port of Mesa experiences in OpenGL stacks a member of 0xlab Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 2 / 24
  • 4. Agenda Agenda OpenGL and Linux: DRI classic and Gallium3D driver models how does it make a developer happy Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 3 / 24
  • 5. OpenGL and Linux Mesa v.s. Proprietary Drivers Isn’t this the case? Mesa Proprietary stability . v performance . v feature set . v it’s free v . Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 4 / 24
  • 6. OpenGL and Linux Not Always Figure: nouveau v.s. nVidia binary driver (phronix) Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 5 / 24
  • 7. OpenGL and Linux People BIG TEAMS / BIG BUDGET Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 6 / 24
  • 8. OpenGL and Linux DRI Direct Rendering Infrastructure, DRI direct rendering Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 7 / 24
  • 9. OpenGL and Linux DRI Direct Rendering Infrastructure, DRI direct rendering core X rendering indirect rendering Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 7 / 24
  • 10. OpenGL and Linux DRI Components Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 8 / 24
  • 11. OpenGL and Linux DRI Components <hw> dri.so is the DRI or 3D driver <hw> drv.so is the DDX or 2D driver <hw>.ko is the DRM kernel module libdrm <hw>.so is the user space library for the DRM module GLX and DRI2 are X11 protocols Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 8 / 24
  • 12. OpenGL and Linux They are all complex DRM driver for buffer management, mode setting, ... (radeon has ∼70k LoC) DDX driver for 2D operations, video, mode setting, ... (radeon has ∼100k LoC) DRI driver for OpenGL (radeon has ∼90k LoC) Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 9 / 24
  • 13. OpenGL and Linux OpenGL under Mesa Classic Driver Model libGL.so <hw>_dri.so libdrm_<hw>.so DRI driver interface Mesa common code HW code In the classic model, there is common code that checks the arguments of an OpenGL call and updates internal states it then calls into the HW code using the function table implemented there There is an almost one-to-one mapping between OpenGL API and the function table that the HW code implements. Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 10 / 24
  • 14. OpenGL and Linux Dissection of the DRI driver libGL.so <hw>_dri.so libdrm_<hw>.so DRI driver interface Mesa common code HW code OS dependent: the HW code display server dependent: none OpenGL dependent: the common and HW code Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 11 / 24
  • 15. OpenGL and Linux Problems with the Classic Model The problems with the classic model are it is OpenGL(ES) only; even the hardware can support OpenVG, OpenCL, ... the driver uses OpenGL data types and objects the driver must handle the differences between OpenGL and the hardware an implementation issue instead of a design issue in view of the DRI architecture Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 12 / 24
  • 16. Gallium3D Ideal Model Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 13 / 24
  • 17. Gallium3D Gallium3D libGL.so <hw>_dri.so libdrm_<hw>.so DRI state tracker pipe driver pipe winsys OpenGL state tracker OS dependent: the pipe winsys display server dependent: none OpenGL dependent: OpenGL state tracker Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 14 / 24
  • 18. Gallium3D Gallium3D libGL.so <hw>_dri.so libdrm_<hw>.so DRI state tracker pipe driver pipe winsys OpenGL state tracker OS dependent: the pipe winsys display server dependent: none OpenGL dependent: OpenGL state tracker The pipe driver is highly protable and has a well-defined interface! Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 14 / 24
  • 19. Gallium3D Classic Model to Gallium3D Model libGL.so <hw>_dri.so libdrm_<hw>.so DRI driver interface Mesa common code HW code DRI state tracker pipe driver pipe winsys OpenGL state tracker This is a non-trivial process DRI and OpenGL state trackers are written once and shared the pipe driver and winsys must be written for each HW new drivers should adopt the Gallium3D model from beginning Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 15 / 24
  • 20. Gallium3D Gallium3D: examples libEGL.so egl_dri2.so <hw>_dri.so libdrm_<hw>.so DRI state tracker pipe driver pipe winsys OpenVG state tracker libOpenCL.so <hw>_dri.so libdrm_<hw>.so DRI state tracker pipe driver pipe winsys OpenCL state tracker (You can also have all OpenGL, OpenVG, and OpenCL state trackers inside a single DRI driver) Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 16 / 24
  • 21. Gallium3D Gallium3D: even for DDX Xorg <hw>_drv.so (DDX) libdrm_<hw>.so DDX state tracker pipe driver pipe winsys A modern DDX driver is more than a 2D driver EXA/UXA Xrender video decoding mode setting KMS Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 17 / 24
  • 22. Gallium3D Gallium3D: SVGA VMWare has a virtual GPU named SVGA. The aquisition of Tungsten Graphics gives vmwgfx.ko DRM module Gallium3D based DRI driver Gallium3D based DDX driver Gallium3D based D3D9 driver (D3D9 state tracker + Windows winsys) Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 18 / 24
  • 23. Developers Gallium3D core Gallium3D core consists of two interfaces: struct pipe screen and struct pipe context helper functions for format conversions, buffer management, vertex processing, and etc. wrappers of OS or compiler dependent functions, such as threads, timing, I/O Pipe drivers implement struct pipe screen and struct pipe context interfaces. State trackers are users of the interfaces. Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 19 / 24
  • 24. Developers struct pipe screen The pipe screen is an abstraction of the adapter. It is used for querying adapter capabilities/limitations creating resources fencing and other misc operations Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 20 / 24
  • 25. Developers struct pipe context The pipe context is an abstraction of the graphics pipeline (and some misc operations) vertex buffers vertex fetcher vertex shader geometry shader stream output buffers textures and constant buffers rasterizer fragment shader per-fragment ops color and depth buffers Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 21 / 24
  • 26. Developers Pseudo Code /∗ c r e a t e t h e p i p e s c r e e n ∗/ s t r u c t p i p e s c r e e n ∗ s c r e e n = o p e n h w d e v i c e ( dev name ) ; /∗ c r e a t e a p i p e c o n t e x t ∗/ s t r u c t p i p e s c r e e n ∗ p i p e = s c r e e n −>c o n t e x t c r e a t e ( / ∗ . . . ∗ / ) ; struct pipe resource ∗ res ; /∗ c r e a t e a r e s o u r c e from t h e s c r e e n ∗/ r e s = s c r e e n −>r e s o u r c e c r e a t e ( / ∗ . . . ∗ / ) ; /∗ s e t t h e r e s o u r c e a s t h e f r a m e b u f f e r ∗/ p i p e −>s e t f r a m e b u f f e r s t a t e ( / ∗ . . . ∗ / ) ; Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 22 / 24
  • 27. Developers It is easier Gallium3D driver model has well-defined interfaces and types is close to the hardware has reusable state trackers has lots of helper functions supports pipe screen/context wrapping: trace, rbug, galahad Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 23 / 24
  • 28. Q&A Q&A Questions? Chia-I Wu (olvaffe@gmail.com) Gallium3D - Mesa’s New Driver Model Mar 27, 2011 24 / 24