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

« back to all changes in this revision

Viewing changes to src/gallium/state_trackers/xorg/xorg_output.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:
51
51
 
52
52
#include "xorg_tracker.h"
53
53
 
 
54
struct output_private
 
55
{
 
56
    drmModeConnectorPtr drm_connector;
 
57
 
 
58
    int c;
 
59
};
 
60
 
54
61
static char *output_enum_list[] = {
55
62
    "Unknown",
56
63
    "VGA",
82
89
static xf86OutputStatus
83
90
output_detect(xf86OutputPtr output)
84
91
{
85
 
    drmModeConnectorPtr drm_connector = output->driver_private;
 
92
    modesettingPtr ms = modesettingPTR(output->scrn);
 
93
    struct output_private *priv = output->driver_private;
 
94
    drmModeConnectorPtr drm_connector;
 
95
    xf86OutputStatus status;
 
96
 
 
97
    drm_connector = drmModeGetConnector(ms->fd, priv->drm_connector->connector_id);
 
98
    if (drm_connector) {
 
99
        drmModeFreeConnector(priv->drm_connector);
 
100
        priv->drm_connector = drm_connector;
 
101
    } else {
 
102
        drm_connector = priv->drm_connector;
 
103
    }
86
104
 
87
105
    switch (drm_connector->connection) {
88
106
    case DRM_MODE_CONNECTED:
89
 
        return XF86OutputStatusConnected;
 
107
        status = XF86OutputStatusConnected;
 
108
        break;
90
109
    case DRM_MODE_DISCONNECTED:
91
 
        return XF86OutputStatusDisconnected;
 
110
        status = XF86OutputStatusDisconnected;
 
111
        break;
92
112
    default:
93
 
        return XF86OutputStatusUnknown;
 
113
        status = XF86OutputStatusUnknown;
94
114
    }
 
115
 
 
116
    return status;
95
117
}
96
118
 
97
119
static DisplayModePtr
98
120
output_get_modes(xf86OutputPtr output)
99
121
{
100
 
    drmModeConnectorPtr drm_connector = output->driver_private;
 
122
    struct output_private *priv = output->driver_private;
 
123
    drmModeConnectorPtr drm_connector = priv->drm_connector;
101
124
    drmModeModeInfoPtr drm_mode = NULL;
102
125
    DisplayModePtr modes = NULL, mode = NULL;
103
126
    int i;
139
162
static int
140
163
output_mode_valid(xf86OutputPtr output, DisplayModePtr pMode)
141
164
{
 
165
    modesettingPtr ms = modesettingPTR(output->scrn);
 
166
    CustomizerPtr cust = ms->cust;
 
167
 
 
168
    if (cust && cust->winsys_check_fb_size &&
 
169
        !cust->winsys_check_fb_size(cust, pMode->HDisplay *
 
170
                                    output->scrn->bitsPerPixel / 8,
 
171
                                    pMode->VDisplay))
 
172
        return MODE_BAD;
 
173
 
142
174
    return MODE_OK;
143
175
}
144
176
 
161
193
static void
162
194
output_destroy(xf86OutputPtr output)
163
195
{
164
 
    drmModeFreeConnector(output->driver_private);
 
196
    struct output_private *priv = output->driver_private;
 
197
    drmModeFreeConnector(priv->drm_connector);
 
198
    xfree(priv);
 
199
    output->driver_private = NULL;
165
200
}
166
201
 
167
202
static const xf86OutputFuncsRec output_funcs = {
188
223
    drmModeResPtr res;
189
224
    drmModeConnectorPtr drm_connector = NULL;
190
225
    drmModeEncoderPtr drm_encoder = NULL;
 
226
    struct output_private *priv;
191
227
    char name[32];
192
228
    int c, v, p;
193
229
 
226
262
                 drm_connector->connector_type_id);
227
263
 
228
264
 
 
265
        priv = xcalloc(sizeof(*priv), 1);
 
266
        if (!priv) {
 
267
            continue;
 
268
        }
 
269
 
229
270
        output = xf86OutputCreate(pScrn, &output_funcs, name);
230
 
        if (!output)
 
271
        if (!output) {
 
272
            xfree(priv);
231
273
            continue;
 
274
        }
232
275
 
233
276
        drm_encoder = drmModeGetEncoder(ms->fd, drm_connector->encoders[0]);
234
277
        if (drm_encoder) {
238
281
            output->possible_crtcs = 0;
239
282
            output->possible_clones = 0;
240
283
        }
241
 
        output->driver_private = drm_connector;
 
284
        priv->c = c;
 
285
        priv->drm_connector = drm_connector;
 
286
        output->driver_private = priv;
242
287
        output->subpixel_order = SubPixelHorizontalRGB;
243
288
        output->interlaceAllowed = FALSE;
244
289
        output->doubleScanAllowed = FALSE;
248
293
    drmModeFreeResources(res);
249
294
}
250
295
 
 
296
unsigned
 
297
xorg_output_get_id(xf86OutputPtr output)
 
298
{
 
299
    struct output_private *priv = output->driver_private;
 
300
    return priv->drm_connector->connector_id;
 
301
}
 
302
 
251
303
/* vim: set sw=4 ts=8 sts=4: */