~ubuntu-branches/ubuntu/natty/mesa/natty-proposed

« back to all changes in this revision

Viewing changes to src/gallium/winsys/i915/drm/i915_drm_winsys.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Hooker, Robert Hooker, Christopher James Halse Rogers
  • Date: 2010-09-14 08:55:40 UTC
  • mfrom: (1.2.28 upstream)
  • Revision ID: james.westby@ubuntu.com-20100914085540-m4fpl0hdjlfd4jgz
Tags: 7.9~git20100909-0ubuntu1
[ Robert Hooker ]
* New upstream git snapshot up to commit 94118fe2d4b1e5 (LP: #631413)
* New features include ATI HD5xxx series support in r600, and a vastly
  improved glsl compiler.
* Remove pre-generated .pc's, use the ones generated at build time
  instead.
* Remove all references to mesa-utils now that its no longer shipped
  with the mesa source.
* Disable the experimental ARB_fragment_shader option by default on
  i915, it exposes incomplete functionality that breaks KDE compositing
  among other things. It can be enabled via driconf still. (LP: #628930).

[ Christopher James Halse Rogers ]
* debian/patches/04_osmesa_version.diff:
  - Refresh for new upstream
* Bugs fixed in this release:
  - Fixes severe rendering corruption in Unity on radeon (LP: #628727,
    LP: #596292, LP: #599741, LP: #630315, LP: #613694, LP: #599741).
  - Also fixes rendering in gnome-shell (LP: #578619).
  - Flickering in OpenGL apps on radeon (LP: #626943, LP: #610541).
  - Provides preliminary support for new intel chips (LP: #601052).
* debian/rules:
  - Update configure flags to match upstream reshuffling.
  - Explicitly remove gallium DRI drivers that we don't want to ship.
* Update debian/gbp.conf for this Maverick-specific packaging
* libegl1-mesa-dri-x11,kms: There are no longer separate kms or x11 drivers
  for EGL, libegl1-mesa-drivers now contains a single driver that provides
  both backends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
 
 
3
#include "state_tracker/drm_driver.h"
 
4
 
 
5
#include "i915_drm_winsys.h"
 
6
#include "i915_drm_public.h"
 
7
#include "util/u_memory.h"
 
8
 
 
9
 
 
10
/*
 
11
 * Helper functions
 
12
 */
 
13
 
 
14
 
 
15
static void
 
16
i915_drm_get_device_id(unsigned int *device_id)
 
17
{
 
18
   char path[512];
 
19
   FILE *file;
 
20
   void *shutup_gcc;
 
21
 
 
22
   /*
 
23
    * FIXME: Fix this up to use a drm ioctl or whatever.
 
24
    */
 
25
 
 
26
   snprintf(path, sizeof(path), "/sys/class/drm/card0/device/device");
 
27
   file = fopen(path, "r");
 
28
   if (!file) {
 
29
      return;
 
30
   }
 
31
 
 
32
   shutup_gcc = fgets(path, sizeof(path), file);
 
33
   (void) shutup_gcc;
 
34
   sscanf(path, "%x", device_id);
 
35
   fclose(file);
 
36
}
 
37
 
 
38
static void
 
39
i915_drm_winsys_destroy(struct i915_winsys *iws)
 
40
{
 
41
   struct i915_drm_winsys *idws = i915_drm_winsys(iws);
 
42
 
 
43
   drm_intel_bufmgr_destroy(idws->pools.gem);
 
44
 
 
45
   FREE(idws);
 
46
}
 
47
 
 
48
struct i915_winsys *
 
49
i915_drm_winsys_create(int drmFD)
 
50
{
 
51
   struct i915_drm_winsys *idws;
 
52
   unsigned int deviceID;
 
53
 
 
54
   idws = CALLOC_STRUCT(i915_drm_winsys);
 
55
   if (!idws)
 
56
      return NULL;
 
57
 
 
58
   i915_drm_get_device_id(&deviceID);
 
59
 
 
60
   i915_drm_winsys_init_batchbuffer_functions(idws);
 
61
   i915_drm_winsys_init_buffer_functions(idws);
 
62
   i915_drm_winsys_init_fence_functions(idws);
 
63
 
 
64
   idws->fd = drmFD;
 
65
   idws->base.pci_id = deviceID;
 
66
   idws->max_batch_size = 16 * 4096;
 
67
 
 
68
   idws->base.destroy = i915_drm_winsys_destroy;
 
69
 
 
70
   idws->pools.gem = drm_intel_bufmgr_gem_init(idws->fd, idws->max_batch_size);
 
71
   drm_intel_bufmgr_gem_enable_reuse(idws->pools.gem);
 
72
 
 
73
   idws->dump_cmd = debug_get_bool_option("I915_DUMP_CMD", FALSE);
 
74
   idws->send_cmd = !debug_get_bool_option("I915_NO_HW", FALSE);
 
75
 
 
76
   return &idws->base;
 
77
}