SlideShare a Scribd company logo
1 of 16
Download to read offline
X Window / Direct Rendering
                                        Architectural Diagram
       Xclient (w/GL)
                        OpenGL I/F
Xlib I/F                                                               Filesystem
                                       libdrm I/F      IOCTL / mmap
                                                                       Driver I/F


                        Mesa                 libdrm
                                                                                               PCI
                                                                                   Direct
 Xlib       Xlib I/F
                                                                                               Driver
                                                                                 Rendering
                                                                                               I/F
                                                                                  Manager
                                                             Filesystem
                                             sockets         Abstraction
                                                                                  AGP GART
                                                                                  Manager
              X protocol                                               Filesystem I/F
                                                                       Driver I/F                          Hard-
                                                              Kernel
                                             sockets
  X Server (device-independent tier)                                                                       ware
                                                                                 AGP GART
                                       libdrm I/F
                XFree86 Tier
                                                                                  Manager
 DIX                                                    IOCTL / Memory
                                             libdrm
 I/F             DGA           DRI                      mmap Manager    MM
                                                                                           PCI
                                                              Subsystem I/F
                                                                                           Driver
              vidmode
                                                                                           I/F
                             Video
           XFree86                           IOCTL /
                                                                IRQ
                 XAA
                                                                              PCI Device
           Extension                         mmap
                             Driver                          Abstraction IRQM
  MI       I/F
                                                                                    Manager
                                                                           I/F
                  Xv
                                                                         2007 © Moriyoshi Koizumi. All Rights Reserved.
X Window / Indirect Rendering
                           Architectural Diagram
       Xclient (w/GL)
                        OpenGL I/F
Xlib I/F                                                             Filesystem
                                                                     Driver I/F


                        Mesa
                                                                                              PCI
                                                                                  Direct
 Xlib       Xlib I/F
                                                                                              Driver
                                                                                Rendering
                                                                                              I/F
                                                                                 Manager
                                                           Filesystem
                                             sockets       Abstraction
                                                                                AGP GART
                                                                                Manager
              X protocol                                             Filesystem I/F
                                                                     Driver I/F                           Hard-
                                                            Kernel
                                             sockets
  X Server (DIX)                                                                                          ware
                        GLX     Mesa
                                                                                AGP GART
       XFree86 Tier                    libdrm I/F
                                                                                 Manager
 DIX                                                   IOCTL / Memory
                                             libdrm
 I/F             DGA           DRI                     mmap Manager   MM
                                                                                          PCI
                                                            Subsystem I/F
                                                                                          Driver
              vidmode
                                                                                          I/F
                              Video
           XFree86                           IOCTL /
                                                              IRQ
                 XAA
                                                                            PCI Device
           Extension                         mmap
                              Driver                       Abstraction IRQM
  MI       I/F
                                                                                   Manager
                                                                          I/F
                  Xv
                                                                        2007 © Moriyoshi Koizumi. All Rights Reserved.
Address Space Layout

                                      Kernel Space
                    Graphics
           MMIO     Aperture
           Space




Physical
                                      User Space
Address
Space
           Actual
           RAM
           Space
                     GART




                                     2007 © Moriyoshi Koizumi. All Rights Reserved.
Direct Memory Access
                            1. Queueing
              Kernel Space               Graphic Controller
               Instruction
                 Buffer          DMA                                FIFO
                                 Transfer



 Marked
Consistent   IOCTL (BLIT etc.)
              User Space

                  Some
                 Process




                                    2007 © Moriyoshi Koizumi. All Rights Reserved.
Direct Memory Access
         2. Bitmap Block Transfer (Blit)
               Kernel Space          Graphic Controller
                                         Active Entry
                              FIFO




                                                   Parse &
               User Space                          Dispatch

                  Some
 Marked
                 Process                Blit Engine
Consistent

                              DMA Transfer
                 Another
                 Process

                               2007 © Moriyoshi Koizumi. All Rights Reserved.
DRM IOCTL I/F

    AUTH (GET_MAGIC / AUTH_MAGIC)
●


    VERSION (GET / SET)
●


    BUSID (GET / SET)
●


    MAP (ADD / RM)
●


    CTX (ADD / RM / GET / SWITCH / NEW /
●


    RESERVE)
    LOCK (LOCK / UNLOCK)
●


    AGP operations
●


    Device-specific operations
●
                                 2007 © Moriyoshi Koizumi. All Rights Reserved.
DRM Authentication

                               1. Retrieve Magic Cookie (drmGetMagic())

                                                              Cookie Manager
                Mesa             libdrm
                                                                              2. Generate
                                                              Direct
Xlib
                                                                              Magic
                                                            Rendering
                                                             Manager          Cookie

                        3. Send Magic
       X protocol       (XF86DRIAuthConnection())     4. Authenticate Cookie
                                                      (drmAuthMagic())
                                             Kernel
       X Server

         XFree86 Tier
                                 libdrm
                        DRI




                                                      2007 © Moriyoshi Koizumi. All Rights Reserved.
DRM Authentication
                                                                (Userland Wrappers)

libdrm/xf86drm.c:
(formally: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c)
int drmGetMagic(int fd, drm_magic_t * magic)
{
     drm_auth_t auth;


    *magic = 0;
    if (ioctl(fd, DRM_IOCTL_GET_MAGIC, &auth)) return -errno;
    *magic = auth.magic;
    return 0;
}




                                                          2007 © Moriyoshi Koizumi. All Rights Reserved.
DRM Authentication
                                                             (Userland Wrappers)

xc/programs/Xserver/hw/xfree86/dri/dri.c:
Bool
DRIAuthConnection(ScreenPtr pScreen, drm_magic_t magic)
{
     DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);


    if (drmAuthMagic(pDRIPriv->drmFD, magic)) return FALSE;
    return TRUE;
}


libdrm/xf86drm.c:
(formally: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c)
  int drmAuthMagic(int fd, drm_magic_t magic)
  {
      drm_auth_t auth;
      auth.magic = magic;
      if (ioctl(fd, DRM_IOCTL_AUTH_MAGIC, &auth)) return -errno;
      return 0;
  }



                                                       2007 © Moriyoshi Koizumi. All Rights Reserved.
DRM Authentication
       (linux/drivers/char/drm/drm_drv.c: IOCTL Dispatch Table)

static drm_ioctl_desc_t drm_ioctls[] = {
   [DRM_IOCTL_NR(DRM_IOCTL_VERSION)] = {drm_version, 0},
   [DRM_IOCTL_NR(DRM_IOCTL_GET_UNIQUE)] = {drm_getunique,
0},
   [DRM_IOCTL_NR(DRM_IOCTL_GET_MAGIC)] = {drm_getmagic, 0},
   [DRM_IOCTL_NR(DRM_IOCTL_IRQ_BUSID)] = {drm_irq_by_busid,
DRM_MASTER|DRM_ROOT_ONLY},
   [DRM_IOCTL_NR(DRM_IOCTL_GET_MAP)] = {drm_getmap, 0},
   [DRM_IOCTL_NR(DRM_IOCTL_GET_CLIENT)] = {drm_getclient,
0},
   [DRM_IOCTL_NR(DRM_IOCTL_SET_VERSION)] = {drm_setversion,
DRM_MASTER|DRM_ROOT_ONLY},
   [DRM_IOCTL_NR(DRM_IOCTL_AUTH_MAGIC)] = {drm_authmagic,
DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},
   [DRM_IOCTL_NR(DRM_IOCTL_ADD_CTX)] = {drm_addctx,
DRM_AUTH|DRM_ROOT_ONLY},
   [DRM_IOCTL_NR(DRM_IOCTL_GET_CTX)] = {drm_getctx,
DRM_AUTH},
...

                                       2007 © Moriyoshi Koizumi. All Rights Reserved.
DRM Authentication
             (linux/drivers/char/drm/drm_drv.c: IOCTL Dispatcher)
if (nr < DRIVER_IOCTL_COUNT)
    ioctl = &drm_ioctls[nr];
else if ((nr >= DRM_COMMAND_BASE)
           && (nr < DRM_COMMAND_BASE + dev->driver->num_ioctls))
    ioctl = &dev->driver->ioctls[nr - DRM_COMMAND_BASE];
else
    goto err_i1;


func = ioctl->func;


/* is there a local override? */
if ((nr == DRM_IOCTL_NR(DRM_IOCTL_DMA)) && dev->driver->dma_ioctl)
        func = dev->driver->dma_ioctl;
if (!func) {
    DRM_DEBUG(quot;no functionnquot;);
    retcode = -EINVAL;
} else if (((ioctl->flags & DRM_ROOT_ONLY) && !capable(CAP_SYS_ADMIN)) ||
       ((ioctl->flags & DRM_AUTH) && !priv->authenticated) ||
       ((ioctl->flags & DRM_MASTER) && !priv->master)) {
    retcode = -EACCES;
} else {
    retcode = func(inode, filp, cmd, arg);
}

                                               2007 © Moriyoshi Koizumi. All Rights Reserved.
DRM Authentication
                (linux/drivers/char/drm/drm_auth.c: Cookie Issuer)

int drm_getmagic(struct inode *inode, struct file *filp,
            unsigned int cmd, unsigned long arg)
{
       ...
                                        typedef unsigned int drm_magic_t;
       /* Find unique magic */
       if (priv->magic) {
                                        typedef struct drm_auth {
           auth.magic = priv->magic;
                                           drm_magic_t magic;
       } else {
           do {                         } drm_auth_t;
               spin_lock(&lock);
               if (!sequence)
                   ++sequence;/* reserve 0 */
               auth.magic = sequence++;
               spin_unlock(&lock);
           } while (drm_find_file(dev, auth.magic));
           priv->magic = auth.magic;
           drm_add_magic(dev, priv, auth.magic);
       }


       DRM_DEBUG(quot;%unquot;, auth.magic);
       if (copy_to_user((drm_auth_t __user *) arg, &auth, sizeof(auth)))
           return -EFAULT;
       return 0;
}

                                               2007 © Moriyoshi Koizumi. All Rights Reserved.
DRM Authentication
                (linux/drivers/char/drm/drm_auth.c: Cookie Verifier)


int drm_authmagic(struct inode *inode, struct file *filp,
          unsigned int cmd, unsigned long arg)
{
    drm_file_t *priv = filp->private_data;
    drm_device_t *dev = priv->head->dev;
    drm_auth_t auth;
    drm_file_t *file;


    if (copy_from_user(&auth, (drm_auth_t __user *) arg, sizeof(auth)))
        return -EFAULT;
    DRM_DEBUG(quot;%unquot;, auth.magic);
    if ((file = drm_find_file(dev, auth.magic))) {
        file->authenticated = 1;
        drm_remove_magic(dev, auth.magic);
        return 0;
    }
    return -EINVAL;
}




                                                2007 © Moriyoshi Koizumi. All Rights Reserved.
DRM Authentication
                (linux/drivers/char/drm/drm_auth.c: Cookie Keeper)



static drm_file_t *drm_find_file(drm_device_t * dev, drm_magic_t magic)
{
    drm_file_t *retval = NULL;
    drm_magic_entry_t *pt;
    int hash = drm_hash_magic(magic);


    mutex_lock(&dev->struct_mutex);
    for (pt = dev->magiclist[hash].head; pt; pt = pt->next) {
        if (pt->magic == magic) {
            retval = pt->priv;
            break;
        }
    }
    mutex_unlock(&dev->struct_mutex);
    return retval;
}




                                                2007 © Moriyoshi Koizumi. All Rights Reserved.
Graphic Address Remapping Table
                          (GART)
   SAREA
  Frame Buffer       Phy-Phy Address Translation
 Texture Buffer                                    Process #1
                         (by AGP controller)
                       Graphics
            MMIO       Aperture                                               Virtual
            Space                                                             Memory
                                                                              Space


Physical
                                                   Process #2
Address
Space
            Actual                                                            Virtual
            RAM                                                               Memory
            Space                                                             Space
                         GART


                                              Phy-Virt Address
                                              Translation (by MMU)

                                                   2007 © Moriyoshi Koizumi. All Rights Reserved.
AGPGART IOCTL I/F

    ACQUIRE
●



    SETUP
●



    RESERVE
●



    PROTECT
●



    ALLOCATE / DEALLOCATE
●



    BIND / UNBIND
●




                            2007 © Moriyoshi Koizumi. All Rights Reserved.

More Related Content

What's hot

LAS16-403: GDB Linux Kernel Awareness
LAS16-403: GDB Linux Kernel AwarenessLAS16-403: GDB Linux Kernel Awareness
LAS16-403: GDB Linux Kernel AwarenessLinaro
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/CoreShay Cohen
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoCMacpaul Lin
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequenceHoucheng Lin
 
Linux Instrumentation
Linux InstrumentationLinux Instrumentation
Linux InstrumentationDarkStarSword
 
linux device driver
linux device driverlinux device driver
linux device driverRahul Batra
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBshimosawa
 
Static partitioning virtualization on RISC-V
Static partitioning virtualization on RISC-VStatic partitioning virtualization on RISC-V
Static partitioning virtualization on RISC-VRISC-V International
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)shimosawa
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux DevelopersOpersys inc.
 
Building Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCCBuilding Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCCKernel TLV
 
QEMU - Binary Translation
QEMU - Binary Translation QEMU - Binary Translation
QEMU - Binary Translation Jiann-Fuh Liaw
 
Linux Porting to a Custom Board
Linux Porting to a Custom BoardLinux Porting to a Custom Board
Linux Porting to a Custom BoardPatrick Bellasi
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Opersys inc.
 

What's hot (20)

Embedded Android : System Development - Part III (Audio / Video HAL)
Embedded Android : System Development - Part III (Audio / Video HAL)Embedded Android : System Development - Part III (Audio / Video HAL)
Embedded Android : System Development - Part III (Audio / Video HAL)
 
LAS16-403: GDB Linux Kernel Awareness
LAS16-403: GDB Linux Kernel AwarenessLAS16-403: GDB Linux Kernel Awareness
LAS16-403: GDB Linux Kernel Awareness
 
Embedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernelEmbedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernel
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
 
Linux Instrumentation
Linux InstrumentationLinux Instrumentation
Linux Instrumentation
 
linux device driver
linux device driverlinux device driver
linux device driver
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
 
Static partitioning virtualization on RISC-V
Static partitioning virtualization on RISC-VStatic partitioning virtualization on RISC-V
Static partitioning virtualization on RISC-V
 
Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
 
Linux Programming
Linux ProgrammingLinux Programming
Linux Programming
 
Building Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCCBuilding Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCC
 
Linux Internals - Part I
Linux Internals - Part ILinux Internals - Part I
Linux Internals - Part I
 
QEMU - Binary Translation
QEMU - Binary Translation QEMU - Binary Translation
QEMU - Binary Translation
 
Platform Drivers
Platform DriversPlatform Drivers
Platform Drivers
 
Linux Porting to a Custom Board
Linux Porting to a Custom BoardLinux Porting to a Custom Board
Linux Porting to a Custom Board
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
 

Similar to X Window Direct Rendering Architectural Diagram

20111130 hardware-monitoring-with-the-new-ipmi-plugin-v2
20111130 hardware-monitoring-with-the-new-ipmi-plugin-v220111130 hardware-monitoring-with-the-new-ipmi-plugin-v2
20111130 hardware-monitoring-with-the-new-ipmi-plugin-v2Werner Fischer
 
Raise your Uptime - How to monitor heterogeneous server environments with Linux
Raise your Uptime - How to monitor heterogeneous server environments with LinuxRaise your Uptime - How to monitor heterogeneous server environments with Linux
Raise your Uptime - How to monitor heterogeneous server environments with LinuxWerner Fischer
 
Open Storage Sun Intel European Business Technology Tour
Open Storage Sun Intel European Business Technology TourOpen Storage Sun Intel European Business Technology Tour
Open Storage Sun Intel European Business Technology TourWalter Moriconi
 
Benefits of Using FPGAs for Embedded Processing: Embedded World 2010
Benefits of Using FPGAs for Embedded Processing: Embedded World 2010Benefits of Using FPGAs for Embedded Processing: Embedded World 2010
Benefits of Using FPGAs for Embedded Processing: Embedded World 2010Altera Corporation
 
FPGA Camp - Intellitech Presentation
FPGA Camp - Intellitech PresentationFPGA Camp - Intellitech Presentation
FPGA Camp - Intellitech PresentationFPGA Central
 
Unified workflow review (gen)
Unified workflow review (gen)Unified workflow review (gen)
Unified workflow review (gen)Baiju Gujarathi
 
Jaguar x86 Core Functional Verification
Jaguar x86 Core Functional VerificationJaguar x86 Core Functional Verification
Jaguar x86 Core Functional VerificationDVClub
 
Sears Point Racetrack
Sears Point RacetrackSears Point Racetrack
Sears Point RacetrackDino, llc
 
Lte Latam 2012 Alberto Boaventura V6
Lte Latam 2012 Alberto Boaventura V6Lte Latam 2012 Alberto Boaventura V6
Lte Latam 2012 Alberto Boaventura V6Alberto Boaventura
 
Mpc5121 econfs
Mpc5121 econfsMpc5121 econfs
Mpc5121 econfsDino, llc
 
Ap nr5000 pt file
Ap nr5000 pt fileAp nr5000 pt file
Ap nr5000 pt fileAddPac1999
 
Linux-without-a-bootloader
Linux-without-a-bootloaderLinux-without-a-bootloader
Linux-without-a-bootloaderNishanth Menon
 
Презентация команды "Обыватели"
Презентация команды "Обыватели"Презентация команды "Обыватели"
Презентация команды "Обыватели"Tatyana Savchyk
 
9800301 04 8080-8085_assembly_language_programming_manual_may81
9800301 04 8080-8085_assembly_language_programming_manual_may819800301 04 8080-8085_assembly_language_programming_manual_may81
9800301 04 8080-8085_assembly_language_programming_manual_may81satolina
 
PA Develops an LTE PHY for Catapult
PA Develops an LTE PHY for CatapultPA Develops an LTE PHY for Catapult
PA Develops an LTE PHY for Catapultgrahambell
 
LF_DPDK17_mediated devices: better userland IO
LF_DPDK17_mediated devices: better userland IOLF_DPDK17_mediated devices: better userland IO
LF_DPDK17_mediated devices: better userland IOLF_DPDK
 

Similar to X Window Direct Rendering Architectural Diagram (20)

20111130 hardware-monitoring-with-the-new-ipmi-plugin-v2
20111130 hardware-monitoring-with-the-new-ipmi-plugin-v220111130 hardware-monitoring-with-the-new-ipmi-plugin-v2
20111130 hardware-monitoring-with-the-new-ipmi-plugin-v2
 
Raise your Uptime - How to monitor heterogeneous server environments with Linux
Raise your Uptime - How to monitor heterogeneous server environments with LinuxRaise your Uptime - How to monitor heterogeneous server environments with Linux
Raise your Uptime - How to monitor heterogeneous server environments with Linux
 
Thesis Donato Slides EN
Thesis Donato Slides ENThesis Donato Slides EN
Thesis Donato Slides EN
 
Hybrid Programmable Forwarding Planes: BoF Session
Hybrid Programmable Forwarding Planes: BoF SessionHybrid Programmable Forwarding Planes: BoF Session
Hybrid Programmable Forwarding Planes: BoF Session
 
z/VM Platform Update
z/VM Platform Updatez/VM Platform Update
z/VM Platform Update
 
Open Storage Sun Intel European Business Technology Tour
Open Storage Sun Intel European Business Technology TourOpen Storage Sun Intel European Business Technology Tour
Open Storage Sun Intel European Business Technology Tour
 
Benefits of Using FPGAs for Embedded Processing: Embedded World 2010
Benefits of Using FPGAs for Embedded Processing: Embedded World 2010Benefits of Using FPGAs for Embedded Processing: Embedded World 2010
Benefits of Using FPGAs for Embedded Processing: Embedded World 2010
 
FPGA Camp - Intellitech Presentation
FPGA Camp - Intellitech PresentationFPGA Camp - Intellitech Presentation
FPGA Camp - Intellitech Presentation
 
Unified workflow review (gen)
Unified workflow review (gen)Unified workflow review (gen)
Unified workflow review (gen)
 
Jaguar x86 Core Functional Verification
Jaguar x86 Core Functional VerificationJaguar x86 Core Functional Verification
Jaguar x86 Core Functional Verification
 
Sears Point Racetrack
Sears Point RacetrackSears Point Racetrack
Sears Point Racetrack
 
Lte Latam 2012 Alberto Boaventura V6
Lte Latam 2012 Alberto Boaventura V6Lte Latam 2012 Alberto Boaventura V6
Lte Latam 2012 Alberto Boaventura V6
 
Mpc5121 econfs
Mpc5121 econfsMpc5121 econfs
Mpc5121 econfs
 
Ap nr5000 pt file
Ap nr5000 pt fileAp nr5000 pt file
Ap nr5000 pt file
 
Linux-without-a-bootloader
Linux-without-a-bootloaderLinux-without-a-bootloader
Linux-without-a-bootloader
 
Презентация команды "Обыватели"
Презентация команды "Обыватели"Презентация команды "Обыватели"
Презентация команды "Обыватели"
 
Linux on System z disk I/O performance
Linux on System z disk I/O performanceLinux on System z disk I/O performance
Linux on System z disk I/O performance
 
9800301 04 8080-8085_assembly_language_programming_manual_may81
9800301 04 8080-8085_assembly_language_programming_manual_may819800301 04 8080-8085_assembly_language_programming_manual_may81
9800301 04 8080-8085_assembly_language_programming_manual_may81
 
PA Develops an LTE PHY for Catapult
PA Develops an LTE PHY for CatapultPA Develops an LTE PHY for Catapult
PA Develops an LTE PHY for Catapult
 
LF_DPDK17_mediated devices: better userland IO
LF_DPDK17_mediated devices: better userland IOLF_DPDK17_mediated devices: better userland IO
LF_DPDK17_mediated devices: better userland IO
 

More from Moriyoshi Koizumi

Goをカンストさせる話
Goをカンストさせる話Goをカンストさせる話
Goをカンストさせる話Moriyoshi Koizumi
 
Authentication, Authorization, OAuth, OpenID Connect and Pyramid
Authentication, Authorization, OAuth, OpenID Connect and PyramidAuthentication, Authorization, OAuth, OpenID Connect and Pyramid
Authentication, Authorization, OAuth, OpenID Connect and PyramidMoriyoshi Koizumi
 
All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2goMoriyoshi Koizumi
 
HLSについて知っていることを話します
HLSについて知っていることを話しますHLSについて知っていることを話します
HLSについて知っていることを話しますMoriyoshi Koizumi
 
Pyramidのrendererをカスタマイズする
PyramidのrendererをカスタマイズするPyramidのrendererをカスタマイズする
PyramidのrendererをカスタマイズするMoriyoshi Koizumi
 
Hacking Go Compiler Internals / GoCon 2014 Autumn
Hacking Go Compiler Internals / GoCon 2014 AutumnHacking Go Compiler Internals / GoCon 2014 Autumn
Hacking Go Compiler Internals / GoCon 2014 AutumnMoriyoshi Koizumi
 
よいことも悪いこともぜんぶPHPが教えてくれた
よいことも悪いこともぜんぶPHPが教えてくれたよいことも悪いこともぜんぶPHPが教えてくれた
よいことも悪いこともぜんぶPHPが教えてくれたMoriyoshi Koizumi
 
mod_himoteからはじめよう
mod_himoteからはじめようmod_himoteからはじめよう
mod_himoteからはじめようMoriyoshi Koizumi
 
HPHPは約束の地なのか
HPHPは約束の地なのかHPHPは約束の地なのか
HPHPは約束の地なのかMoriyoshi Koizumi
 
Phjosh(仮)プロジェクト
Phjosh(仮)プロジェクトPhjosh(仮)プロジェクト
Phjosh(仮)プロジェクトMoriyoshi Koizumi
 

More from Moriyoshi Koizumi (20)

Goをカンストさせる話
Goをカンストさせる話Goをカンストさせる話
Goをカンストさせる話
 
PHP7を魔改造した話
PHP7を魔改造した話PHP7を魔改造した話
PHP7を魔改造した話
 
Authentication, Authorization, OAuth, OpenID Connect and Pyramid
Authentication, Authorization, OAuth, OpenID Connect and PyramidAuthentication, Authorization, OAuth, OpenID Connect and Pyramid
Authentication, Authorization, OAuth, OpenID Connect and Pyramid
 
All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2go
 
HLSについて知っていることを話します
HLSについて知っていることを話しますHLSについて知っていることを話します
HLSについて知っていることを話します
 
Pyramidのrendererをカスタマイズする
PyramidのrendererをカスタマイズするPyramidのrendererをカスタマイズする
Pyramidのrendererをカスタマイズする
 
Hacking Go Compiler Internals / GoCon 2014 Autumn
Hacking Go Compiler Internals / GoCon 2014 AutumnHacking Go Compiler Internals / GoCon 2014 Autumn
Hacking Go Compiler Internals / GoCon 2014 Autumn
 
Uguisudani
UguisudaniUguisudani
Uguisudani
 
よいことも悪いこともぜんぶPHPが教えてくれた
よいことも悪いこともぜんぶPHPが教えてくれたよいことも悪いこともぜんぶPHPが教えてくれた
よいことも悪いこともぜんぶPHPが教えてくれた
 
Ik in action
Ik in actionIk in action
Ik in action
 
Nginx lua
Nginx luaNginx lua
Nginx lua
 
Haxeについて
HaxeについてHaxeについて
Haxeについて
 
Gocon2013
Gocon2013Gocon2013
Gocon2013
 
PHP language update 201211
PHP language update 201211PHP language update 201211
PHP language update 201211
 
mod_himoteからはじめよう
mod_himoteからはじめようmod_himoteからはじめよう
mod_himoteからはじめよう
 
HPHPは約束の地なのか
HPHPは約束の地なのかHPHPは約束の地なのか
HPHPは約束の地なのか
 
Pyfes201110
Pyfes201110Pyfes201110
Pyfes201110
 
Phjosh(仮)プロジェクト
Phjosh(仮)プロジェクトPhjosh(仮)プロジェクト
Phjosh(仮)プロジェクト
 
Aaなゲームをjsで
AaなゲームをjsでAaなゲームをjsで
Aaなゲームをjsで
 
Aaなゲームをjsで
AaなゲームをjsでAaなゲームをjsで
Aaなゲームをjsで
 

Recently uploaded

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 

Recently uploaded (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 

X Window Direct Rendering Architectural Diagram

  • 1. X Window / Direct Rendering Architectural Diagram Xclient (w/GL) OpenGL I/F Xlib I/F Filesystem libdrm I/F IOCTL / mmap Driver I/F Mesa libdrm PCI Direct Xlib Xlib I/F Driver Rendering I/F Manager Filesystem sockets Abstraction AGP GART Manager X protocol Filesystem I/F Driver I/F Hard- Kernel sockets X Server (device-independent tier) ware AGP GART libdrm I/F XFree86 Tier Manager DIX IOCTL / Memory libdrm I/F DGA DRI mmap Manager MM PCI Subsystem I/F Driver vidmode I/F Video XFree86 IOCTL / IRQ XAA PCI Device Extension mmap Driver Abstraction IRQM MI I/F Manager I/F Xv 2007 © Moriyoshi Koizumi. All Rights Reserved.
  • 2. X Window / Indirect Rendering Architectural Diagram Xclient (w/GL) OpenGL I/F Xlib I/F Filesystem Driver I/F Mesa PCI Direct Xlib Xlib I/F Driver Rendering I/F Manager Filesystem sockets Abstraction AGP GART Manager X protocol Filesystem I/F Driver I/F Hard- Kernel sockets X Server (DIX) ware GLX Mesa AGP GART XFree86 Tier libdrm I/F Manager DIX IOCTL / Memory libdrm I/F DGA DRI mmap Manager MM PCI Subsystem I/F Driver vidmode I/F Video XFree86 IOCTL / IRQ XAA PCI Device Extension mmap Driver Abstraction IRQM MI I/F Manager I/F Xv 2007 © Moriyoshi Koizumi. All Rights Reserved.
  • 3. Address Space Layout Kernel Space Graphics MMIO Aperture Space Physical User Space Address Space Actual RAM Space GART 2007 © Moriyoshi Koizumi. All Rights Reserved.
  • 4. Direct Memory Access 1. Queueing Kernel Space Graphic Controller Instruction Buffer DMA FIFO Transfer Marked Consistent IOCTL (BLIT etc.) User Space Some Process 2007 © Moriyoshi Koizumi. All Rights Reserved.
  • 5. Direct Memory Access 2. Bitmap Block Transfer (Blit) Kernel Space Graphic Controller Active Entry FIFO Parse & User Space Dispatch Some Marked Process Blit Engine Consistent DMA Transfer Another Process 2007 © Moriyoshi Koizumi. All Rights Reserved.
  • 6. DRM IOCTL I/F AUTH (GET_MAGIC / AUTH_MAGIC) ● VERSION (GET / SET) ● BUSID (GET / SET) ● MAP (ADD / RM) ● CTX (ADD / RM / GET / SWITCH / NEW / ● RESERVE) LOCK (LOCK / UNLOCK) ● AGP operations ● Device-specific operations ● 2007 © Moriyoshi Koizumi. All Rights Reserved.
  • 7. DRM Authentication 1. Retrieve Magic Cookie (drmGetMagic()) Cookie Manager Mesa libdrm 2. Generate Direct Xlib Magic Rendering Manager Cookie 3. Send Magic X protocol (XF86DRIAuthConnection()) 4. Authenticate Cookie (drmAuthMagic()) Kernel X Server XFree86 Tier libdrm DRI 2007 © Moriyoshi Koizumi. All Rights Reserved.
  • 8. DRM Authentication (Userland Wrappers) libdrm/xf86drm.c: (formally: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c) int drmGetMagic(int fd, drm_magic_t * magic) { drm_auth_t auth; *magic = 0; if (ioctl(fd, DRM_IOCTL_GET_MAGIC, &auth)) return -errno; *magic = auth.magic; return 0; } 2007 © Moriyoshi Koizumi. All Rights Reserved.
  • 9. DRM Authentication (Userland Wrappers) xc/programs/Xserver/hw/xfree86/dri/dri.c: Bool DRIAuthConnection(ScreenPtr pScreen, drm_magic_t magic) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (drmAuthMagic(pDRIPriv->drmFD, magic)) return FALSE; return TRUE; } libdrm/xf86drm.c: (formally: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c) int drmAuthMagic(int fd, drm_magic_t magic) { drm_auth_t auth; auth.magic = magic; if (ioctl(fd, DRM_IOCTL_AUTH_MAGIC, &auth)) return -errno; return 0; } 2007 © Moriyoshi Koizumi. All Rights Reserved.
  • 10. DRM Authentication (linux/drivers/char/drm/drm_drv.c: IOCTL Dispatch Table) static drm_ioctl_desc_t drm_ioctls[] = { [DRM_IOCTL_NR(DRM_IOCTL_VERSION)] = {drm_version, 0}, [DRM_IOCTL_NR(DRM_IOCTL_GET_UNIQUE)] = {drm_getunique, 0}, [DRM_IOCTL_NR(DRM_IOCTL_GET_MAGIC)] = {drm_getmagic, 0}, [DRM_IOCTL_NR(DRM_IOCTL_IRQ_BUSID)] = {drm_irq_by_busid, DRM_MASTER|DRM_ROOT_ONLY}, [DRM_IOCTL_NR(DRM_IOCTL_GET_MAP)] = {drm_getmap, 0}, [DRM_IOCTL_NR(DRM_IOCTL_GET_CLIENT)] = {drm_getclient, 0}, [DRM_IOCTL_NR(DRM_IOCTL_SET_VERSION)] = {drm_setversion, DRM_MASTER|DRM_ROOT_ONLY}, [DRM_IOCTL_NR(DRM_IOCTL_AUTH_MAGIC)] = {drm_authmagic, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY}, [DRM_IOCTL_NR(DRM_IOCTL_ADD_CTX)] = {drm_addctx, DRM_AUTH|DRM_ROOT_ONLY}, [DRM_IOCTL_NR(DRM_IOCTL_GET_CTX)] = {drm_getctx, DRM_AUTH}, ... 2007 © Moriyoshi Koizumi. All Rights Reserved.
  • 11. DRM Authentication (linux/drivers/char/drm/drm_drv.c: IOCTL Dispatcher) if (nr < DRIVER_IOCTL_COUNT) ioctl = &drm_ioctls[nr]; else if ((nr >= DRM_COMMAND_BASE) && (nr < DRM_COMMAND_BASE + dev->driver->num_ioctls)) ioctl = &dev->driver->ioctls[nr - DRM_COMMAND_BASE]; else goto err_i1; func = ioctl->func; /* is there a local override? */ if ((nr == DRM_IOCTL_NR(DRM_IOCTL_DMA)) && dev->driver->dma_ioctl) func = dev->driver->dma_ioctl; if (!func) { DRM_DEBUG(quot;no functionnquot;); retcode = -EINVAL; } else if (((ioctl->flags & DRM_ROOT_ONLY) && !capable(CAP_SYS_ADMIN)) || ((ioctl->flags & DRM_AUTH) && !priv->authenticated) || ((ioctl->flags & DRM_MASTER) && !priv->master)) { retcode = -EACCES; } else { retcode = func(inode, filp, cmd, arg); } 2007 © Moriyoshi Koizumi. All Rights Reserved.
  • 12. DRM Authentication (linux/drivers/char/drm/drm_auth.c: Cookie Issuer) int drm_getmagic(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) { ... typedef unsigned int drm_magic_t; /* Find unique magic */ if (priv->magic) { typedef struct drm_auth { auth.magic = priv->magic; drm_magic_t magic; } else { do { } drm_auth_t; spin_lock(&lock); if (!sequence) ++sequence;/* reserve 0 */ auth.magic = sequence++; spin_unlock(&lock); } while (drm_find_file(dev, auth.magic)); priv->magic = auth.magic; drm_add_magic(dev, priv, auth.magic); } DRM_DEBUG(quot;%unquot;, auth.magic); if (copy_to_user((drm_auth_t __user *) arg, &auth, sizeof(auth))) return -EFAULT; return 0; } 2007 © Moriyoshi Koizumi. All Rights Reserved.
  • 13. DRM Authentication (linux/drivers/char/drm/drm_auth.c: Cookie Verifier) int drm_authmagic(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) { drm_file_t *priv = filp->private_data; drm_device_t *dev = priv->head->dev; drm_auth_t auth; drm_file_t *file; if (copy_from_user(&auth, (drm_auth_t __user *) arg, sizeof(auth))) return -EFAULT; DRM_DEBUG(quot;%unquot;, auth.magic); if ((file = drm_find_file(dev, auth.magic))) { file->authenticated = 1; drm_remove_magic(dev, auth.magic); return 0; } return -EINVAL; } 2007 © Moriyoshi Koizumi. All Rights Reserved.
  • 14. DRM Authentication (linux/drivers/char/drm/drm_auth.c: Cookie Keeper) static drm_file_t *drm_find_file(drm_device_t * dev, drm_magic_t magic) { drm_file_t *retval = NULL; drm_magic_entry_t *pt; int hash = drm_hash_magic(magic); mutex_lock(&dev->struct_mutex); for (pt = dev->magiclist[hash].head; pt; pt = pt->next) { if (pt->magic == magic) { retval = pt->priv; break; } } mutex_unlock(&dev->struct_mutex); return retval; } 2007 © Moriyoshi Koizumi. All Rights Reserved.
  • 15. Graphic Address Remapping Table (GART) SAREA Frame Buffer Phy-Phy Address Translation Texture Buffer Process #1 (by AGP controller) Graphics MMIO Aperture Virtual Space Memory Space Physical Process #2 Address Space Actual Virtual RAM Memory Space Space GART Phy-Virt Address Translation (by MMU) 2007 © Moriyoshi Koizumi. All Rights Reserved.
  • 16. AGPGART IOCTL I/F ACQUIRE ● SETUP ● RESERVE ● PROTECT ● ALLOCATE / DEALLOCATE ● BIND / UNBIND ● 2007 © Moriyoshi Koizumi. All Rights Reserved.