intel_device.c File Reference

Include dependency graph for intel_device.c:

Go to the source code of this file.

Functions

int intel_create_device (struct egl_drm_device *device)
int intel_destroy_device (struct egl_drm_device *device)
int intel_create_drawable (struct egl_drm_drawable *drawable, const __GLcontextModes *visual)
int intel_destroy_drawable (struct egl_drm_drawable *drawable)

Variables

struct dri_extension card_extensions []
 Extension strings exported by the intel driver.


Function Documentation

int intel_create_device ( struct egl_drm_device device  ) 

Definition at line 44 of file intel_device.c.

References intel_be_device::base, intel_device::base, CALLOC_STRUCT, card_extensions, intel_device::device, egl_drm_device::deviceID, intel_device::deviceID, egl_drm_device::drmFD, FALSE, i915_create_screen(), intel_be_init_device(), intel_device::pipe, egl_drm_device::priv, and TRUE.

00045 {
00046         struct intel_device *intel_device;
00047 
00048         /* Allocate the private area */
00049         intel_device = CALLOC_STRUCT(intel_device);
00050         if (!intel_device)
00051                 return FALSE;
00052 
00053         device->priv = (void *)intel_device;
00054         intel_device->device = device;
00055 
00056         intel_device->deviceID = device->deviceID;
00057 
00058         intel_be_init_device(&intel_device->base, device->drmFD, intel_device->deviceID);
00059 
00060         intel_device->pipe = i915_create_screen(&intel_device->base.base, intel_device->deviceID);
00061 
00062         /* hack */
00063         driInitExtensions(NULL, card_extensions, GL_FALSE);
00064 
00065         return TRUE;
00066 }

int intel_create_drawable ( struct egl_drm_drawable drawable,
const __GLcontextModes *  visual 
)

Definition at line 82 of file intel_device.c.

References CALLOC_STRUCT, egl_drm_drawable::device, intel_framebuffer::device, egl_drm_drawable::h, PIPE_FORMAT_A8R8G8B8_UNORM, PIPE_FORMAT_NONE, PIPE_FORMAT_R5G6B5_UNORM, PIPE_FORMAT_S8Z24_UNORM, PIPE_FORMAT_Z16_UNORM, egl_drm_drawable::priv, egl_drm_device::priv, st_create_framebuffer(), intel_framebuffer::stfb, and egl_drm_drawable::w.

00084 {
00085         enum pipe_format colorFormat, depthFormat, stencilFormat;
00086         struct intel_framebuffer *intelfb = CALLOC_STRUCT(intel_framebuffer);
00087 
00088         if (!intelfb)
00089                 return GL_FALSE;
00090 
00091         intelfb->device = drawable->device->priv;
00092 
00093         if (visual->redBits == 5)
00094                 colorFormat = PIPE_FORMAT_R5G6B5_UNORM;
00095         else
00096                 colorFormat = PIPE_FORMAT_A8R8G8B8_UNORM;
00097 
00098         if (visual->depthBits == 16)
00099                 depthFormat = PIPE_FORMAT_Z16_UNORM;
00100         else if (visual->depthBits == 24)
00101                 depthFormat = PIPE_FORMAT_S8Z24_UNORM;
00102         else
00103                 depthFormat = PIPE_FORMAT_NONE;
00104 
00105         if (visual->stencilBits == 8)
00106                 stencilFormat = PIPE_FORMAT_S8Z24_UNORM;
00107         else
00108                 stencilFormat = PIPE_FORMAT_NONE;
00109 
00110         intelfb->stfb = st_create_framebuffer(visual,
00111                         colorFormat,
00112                         depthFormat,
00113                         stencilFormat,
00114                         drawable->w,
00115                         drawable->h,
00116                         (void*) intelfb);
00117 
00118         if (!intelfb->stfb) {
00119                 free(intelfb);
00120                 return GL_FALSE;
00121         }
00122 
00123         drawable->priv = (void *) intelfb;
00124         return GL_TRUE;
00125 }

int intel_destroy_device ( struct egl_drm_device device  ) 

Definition at line 69 of file intel_device.c.

References intel_device::base, intel_be_destroy_device(), egl_drm_device::priv, and TRUE.

00070 {
00071         struct intel_device *intel_device = (struct intel_device *)device->priv;
00072         
00073         intel_be_destroy_device(&intel_device->base);
00074 
00075         free(intel_device);
00076         device->priv = NULL;
00077 
00078         return TRUE;
00079 }

int intel_destroy_drawable ( struct egl_drm_drawable drawable  ) 

Definition at line 128 of file intel_device.c.

References assert, egl_drm_drawable::priv, st_unreference_framebuffer(), intel_framebuffer::stfb, and TRUE.

00129 {
00130         struct intel_framebuffer *intelfb = (struct intel_framebuffer *)drawable->priv;
00131         drawable->priv = NULL;
00132 
00133         assert(intelfb->stfb);
00134         st_unreference_framebuffer(&intelfb->stfb);
00135         free(intelfb);
00136         return TRUE;
00137 }


Variable Documentation

struct dri_extension card_extensions[]

Extension strings exported by the intel driver.

Note:
It appears that ARB_texture_env_crossbar has "disappeared" compared to the old i830-specific driver.

Definition at line 78 of file intel_context.c.


Generated on Tue Sep 29 06:25:49 2009 for Gallium3D by  doxygen 1.5.4