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

« back to all changes in this revision

Viewing changes to src/gallium/winsys/i965/drm/i965_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
 
 
2
#include <stdio.h>
 
3
#include "state_tracker/drm_driver.h"
 
4
 
 
5
#include "i965_drm_winsys.h"
 
6
#include "i965_drm_public.h"
 
7
#include "util/u_memory.h"
 
8
 
 
9
/*
 
10
 * Helper functions
 
11
 */
 
12
 
 
13
 
 
14
static void
 
15
i965_libdrm_get_device_id(unsigned int *device_id)
 
16
{
 
17
   char path[512];
 
18
   FILE *file;
 
19
   void *shutup_gcc;
 
20
 
 
21
   /*
 
22
    * FIXME: Fix this up to use a drm ioctl or whatever.
 
23
    */
 
24
 
 
25
   snprintf(path, sizeof(path), "/sys/class/drm/card0/device/device");
 
26
   file = fopen(path, "r");
 
27
   if (!file) {
 
28
      return;
 
29
   }
 
30
 
 
31
   shutup_gcc = fgets(path, sizeof(path), file);
 
32
   sscanf(path, "%x", device_id);
 
33
   fclose(file);
 
34
}
 
35
 
 
36
static void
 
37
i965_libdrm_winsys_destroy(struct brw_winsys_screen *iws)
 
38
{
 
39
   struct i965_libdrm_winsys *idws = i965_libdrm_winsys(iws);
 
40
 
 
41
   if (BRW_DUMP)
 
42
      debug_printf("%s\n", __FUNCTION__);
 
43
 
 
44
   drm_intel_bufmgr_destroy(idws->gem);
 
45
 
 
46
   FREE(idws);
 
47
}
 
48
 
 
49
struct brw_winsys_screen *
 
50
i965_drm_winsys_screen_create(int drmFD)
 
51
{
 
52
   struct i965_libdrm_winsys *idws;
 
53
 
 
54
   debug_printf("%s\n", __FUNCTION__);
 
55
 
 
56
   idws = CALLOC_STRUCT(i965_libdrm_winsys);
 
57
   if (!idws)
 
58
      return NULL;
 
59
 
 
60
   i965_libdrm_get_device_id(&idws->base.pci_id);
 
61
 
 
62
   i965_libdrm_winsys_init_buffer_functions(idws);
 
63
 
 
64
   idws->fd = drmFD;
 
65
 
 
66
   idws->base.destroy = i965_libdrm_winsys_destroy;
 
67
 
 
68
   idws->gem = drm_intel_bufmgr_gem_init(idws->fd, BRW_BATCH_SIZE);
 
69
   drm_intel_bufmgr_gem_enable_reuse(idws->gem);
 
70
 
 
71
   idws->send_cmd = !debug_get_bool_option("BRW_NO_HW", FALSE);
 
72
 
 
73
   return &idws->base;
 
74
}