Commit Graph

192 Commits

Author SHA1 Message Date
Robert Bragg
bdb645e7f5 kms: defer setting crtc modes until first swap buffers
Instead of creating a dummy framebuffer allocation just so we can setup
crtc modes during display_setup we now wait until the first swap_buffers
request before setting up the crtc modes.

This patch also adds a cogl_kms_display_queue_modes_reset() function
that allows developers to explicitly queue a reset of the crtc modes.
The idea is that applications that handle VT switching can use this for
VT enter events to explicitly ensure their mode is restored since modes
are often not automatically restored correctly.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-04-11 15:44:58 +01:00
Robert Bragg
125c31a70b kms: Add mirror support and env var configurability
This adds support for mirroring the display output on two KMS
connectors.

This patch also checks for a number of environment variables that can
influence how KMS is configured. The following variables can be set:

COGL_KMS_MIRROR: If this is set to anything then Cogl will try and setup
two connectors with the same resolution so that onscreen frame buffers
can be mirrored.

COGL_KMS_CONNECTOR0: This can be set to an integer identifier for a
specific KMS connector id to use for the first output.

COGL_KMS_CONNECTOR0_MODE: Can be set to a mode name like "1024x768"
explicitly select what mode should be used for the first output.

If COGL_KMS_MIRROR is set then COGL_KMS_CONNECTOR1 and
COGL_KMS_CONNECTOR1_MODE can optionally be set to specify a connector id
and mode name for the second output.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-04-11 15:44:58 +01:00
Neil Roberts
f9d3ea03ec kms: Implement the swap buffers notify feature
The KMS EGL platform now notifies when a swap is complete. The
notification is delayed until the application calls
cogl_context_dispatch. The GLX backend doesn't currently do this but I
think that is how it should behave to make it easier for the
application to handle locks and such.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-04-11 15:44:50 +01:00
Neil Roberts
cfefff1500 egl-kms: Use drmModePageFlip
The KMS platform now uses drmModePageFlip to present the buffer. The
main loop mechanism is used to poll for events on the DRM file
descriptor so that we notice when the page flip is complete. The
swap_buffers is throttled so that if there is a pending flip it will
block until it is complete before starting another flip.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-04-11 15:44:45 +01:00
Neil Roberts
d1d2120a91 kms: Use GBM surfaces
Instead of creating FBOs on the GL side, the KMS EGL platform uses the
latest changes to Mesa to create an EGL surface using a GBM surface as
the native surface type. This removes some of the special vtable hooks
that the KMS platform needed because it is now much more similar to
the other platforms.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-04-11 15:44:32 +01:00
Neil Roberts
e7f1582630 Add a CoglPrimitiveTexture interface
This interface represents any textures that are backed by a single
texture in GL and that can be used directly with the
cogl_framebuffer_draw_attributes family of functions. This currently
equates to CoglTexture2D, CoglTexture3D and CoglTextureRectangle.

The interface currently has only one method called
cogl_primitive_set_auto_mipmap. This replaces the
COGL_TEXTURE_NO_AUTO_MIPMAP flag from the CoglTextureFlags parameter
in the constructors. None of the other flags in CoglTextureFlags make
sense for primitive textures so it doesn't seem like a good idea to
need them for primitive constructors.

There is a boolean in the vtable to mark whether a texture type is
primitive which the new cogl_is_primitive function uses. There is also
a new texture virtual called set_auto_mipmap which is only required to
be implemented for primitive textures.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-04-04 17:02:23 +01:00
Adel Gadllah
fd31da45e2 winsys-glx: Don't assume that copy_sub_buffer is synchronized
We initially assumed that copy_sub_buffer is synchronized on
which is only the case for a subset of GPUs for example it is not
synchronized on INTEL gen6 and gen7, so we remove this assumption
for now.

We should have a specific driver / GPU whitelist if we want to enable
this.

https://bugzilla.gnome.org/show_bug.cgi?id=669122

Reviewed-by: Robert Bragg <robert@linux.intel.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-03-15 15:48:13 +00:00
Neil Roberts
185630085c Add -Wmissing-declarations to maintainer flags and fix problems
This option to GCC makes it give a warning whenever a global function
is defined without a declaration. This should catch cases were we've
defined a function but forgot to put it in a header. In that case it
is either only used within one file so we should make it static or we
should declare it in a header.

The following changes where made to fix problems:

• Some functions were made static

• cogl-path.h (the one containing the 1.0 API) was split into two
  files, one defining the functions and one defining the enums so that
  cogl-path.c can include the enum and function declarations from the
  2.0 API as well as the function declarations from the 1.0 API.

• cogl2-clip-state has been removed. This only had one experimental
  function called cogl_clip_push_from_path but as this is unstable we
  might as well remove it favour of the equivalent cogl_framebuffer_*
  API.

• The GLX, SDL and WGL winsys's now have a private header to define
  their get_vtable function instead of directly declaring in the C
  file where it is called.

• All places that were calling COGL_OBJECT_DEFINE need to have the
  cogl_is_whatever function declared so these have been added either
  as a public function or in a private header.

• Some files that were not including the header containing their
  function declarations have been fixed to do so.

• Any unused error quark functions have been removed. If we later want
  them we should add them back one by one and add a declaration for
  them in a header.

• _cogl_is_framebuffer has been renamed to cogl_is_framebuffer and
  made a public function with a declaration in cogl-framebuffer.h

• Similarly for CoglOnscreen.

• cogl_vdraw_indexed_attributes is called
  cogl_framebuffer_vdraw_indexed_attributes in the header. The
  definition has been changed to match the header.

• cogl_index_buffer_allocate has been removed. This had no declaration
  and I'm not sure what it's supposed to do.

• CoglJournal has been changed to use the internal CoglObject macro so
  that it won't define an exported cogl_is_journal symbol.

• The _cogl_blah_pointer_from_handle functions have been removed.
  CoglHandle isn't used much anymore anyway and in the few places
  where it is used I think it's safe to just use the implicit cast
  from void* to the right type.

• The test-utils.h header for the conformance tests explicitly
  disables the -Wmissing-declaration option using a pragma because all
  of the tests declare their main function without a header. Any
  mistakes relating to missing declarations aren't really important
  for the tests.

• cogl_quaternion_init_from_quaternion and init_from_matrix have been
  given declarations in cogl-quaternion.h

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-03-06 18:45:44 +00:00
Neil Roberts
933db01833 cogl-winsys-egl-wayland: Include cogl-wayland-renderer.h
The Wayland winsys defines functions declared in
cogl-wayland-renderer.h so it should include the header to make sure
the declarations are right. This was breaking because currently the
header #defines the _EXP suffixes on to the function names so it would
end up exporting the wrong symbol names.
2012-02-29 17:45:43 +00:00
Robert Bragg
be237cc2b7 renderer: Adds getters/setters for driver preference
This adds api for explicitly choosing what underlying driver cogl should
use internally for rendering as well as api for querying back what
driver is actually in use.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-24 14:42:31 +00:00
Robert Bragg
4e3f9d0fc2 tex-pixmap-x11: remove CoglHandle use + pass context
This also replaces use of CoglHandle with a CoglTexturePixmapX11 type
instead.

This patch also ensures the CoglTexturePixmapX11 constructor take an
explicit CoglContext pointer and can return a GError consistent with
other CoglTexture constructors.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-21 13:26:14 +00:00
Robert Bragg
680f63a48c Remove all internal includes of cogl.h
The cogl.h header is meant to be the public header for including the 1.x
api used by Clutter so we should stop using that as a convenient way to
include all likely prototypes and typedefs. Actually we already do a
good job of listing the specific headers we depend on in each of the .c
files we have so mostly this patch just strip out the redundant
includes for cogl.h with a few fixups where that broke the build.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-20 23:12:45 +00:00
Damien Leone
8b70468598 Improve pixel format detection for fallback OpenGL rendering
The previous detection was based on bits per pixel only and would
consider bpp >= 24 as X888 or 8888 24-bit color depth formats.

This commit ensures we now use the newly added
_cogl_util_pixel_format_from_masks() api that returns a CoglPixelFormat
according to channel masks and color depth. This helps to add support
for more pixel formats.

https://bugzilla.gnome.org/show_bug.cgi?id=660188

Reviewed-by: Robert Bragg <robert@linux.intel.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-20 23:12:45 +00:00
Robert Bragg
1022c285c6 texture-pixmap-x11.h: define __COGL_H_INSIDE__
Ideally we wouldn't have exposed cogl-texture-pixmap-x11.h as a
top level header and would have just automatically included it in cogl.h
but we already have code that assumes it can be directly included.

This ensures we define __COGL_H_INSIDE__ as a reminder that it is a top
level header in case we later need to include other cogl internal cogl
headers which would cause a build time error without this defined.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-20 23:12:44 +00:00
Neil Roberts
8012eee31f Add _cogl_texture_get_type()
This adds an internal function to get the type of the underlying
hardware texture for any CoglTexture. It can return one of three
values to represent 2D textures, 3D textures or rectangle textures.
The idea is that this can be used as a replacement for
cogl_texture_get_gl_texture when only the target is required to make
it a bit less GL-centric. The implementation adds a new virtual
function which all of the texture backends now implement.

The enum is in a public header because a later patch will want to use
it from the CoglPipeline API. We may want to consider making the
function public too later.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-02-13 17:02:46 +00:00
Robert Bragg
15d43bb697 glx: Only call swap_buffer callbacks @ dispatch time
This ensures we don't call swap buffer notify callback functions
immediately when they are received since it could be awkward for
applications to ensure they have dropped all necessary locks if they
don't know when callbacks might be invoked.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-08 18:58:06 +00:00
Robert Bragg
0f33c942f2 kms: gracefully handle NULL save_state at cleanup
If we failed to save any crtc state then we skip trying to restore the
old state at cleanup.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-08 17:00:25 +00:00
Robert Bragg
1a638b6fd6 kms: Adds api to get at the kms file descriptor
This adds a cogl_kms_renderer_get_kms_fd() function that lets developers
access the kms file descriptor being used for controlling the kernel
mode setting.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-02-08 17:00:25 +00:00
Neil Roberts
99c651d2b4 Move the add_swap_buffers_callback functions out of the winsys
Instead of having each winsys implement its own list of callbacks the
list is now just attached directly to the CoglOnscreen using code in
cogl-onscreen.c. The winsys's can invoke this list of callbacks by
calling _cogl_onscreen_notify_swap_buffers(). All of the winsys's
would probably have a very similar implementation for this anyway and
I don't think it makes much sense to try and save the cost of a list
pointer in the CoglOnscreen struct.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-02-08 17:00:25 +00:00
Neil Roberts
139421de19 object: Remove the type member of CoglObjectClass
Unlike in GObject the type number for a CoglObject is entirely an
internal implementation detail so there is no need to make a GQuark to
make it safe to export out of the library. Instead we can just
directly use a fixed pointer address as the identifier for the type.
This patch makes it use the address of the class struct of the
identifier. This should make it faster to do type checks because it
does not need to call a function every time it wants to get the type
number.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-01-27 17:18:32 +00:00
Robert Bragg
87ce1b21f9 wayland: perform buffer resizes lazily at swap buffers
Resizing a wayland client framebuffer should not affect the viewport
of additional primitives drawn to that framebuffer before the next swap
buffers request nor should querying the framebuffer's width and height
be affected until the next swap buffers request completes.

This patch changes cogl_wayland_onscreen_resize() so it only saves the
new geometry as "pending" state internal to the given CoglOnscreen. Only
when cogl_framebuffer_swap_buffers() is next called will the pending
size be flushed to the wayland egl api.
2012-01-16 18:27:20 +00:00
Robert Bragg
e1bd0b2090 Swaps a few uses of gint for int
We've avoiding using the redundant glib typedefs such as guint, gint
gpointer etc and prefer to use the equivalent C types so this patch
removes a few uses of gint that slipped past review.
2012-01-16 18:27:20 +00:00
Robert Bragg
3161f1b0e6 template: Allow configuration of swap throttle
This adds cogl_onscreen_template_set_swap_throttled() api that allows
developers to specify their preference for swap buffer throttling
up-front as part of the onscreen template that is used to create a
CoglDisplay when initializing Cogl. This is desirable because some
platforms may not support configuring swap throttling on a per
framebuffer basis and also since applications often want to apply the
same policy to all onscreen framebuffers anyway.
2012-01-16 18:27:20 +00:00
Robert Bragg
a8513c1d77 renderer: Adds api to add/remove selection constraints
This allows applications to specify certain constraints that feed into
the process of selecting a CoglRenderer backend. For example
applications might depend on x11 for handling input and so they require
a backend that's also based on x11.
2012-01-16 18:27:19 +00:00
Rob Bradford
8632c65e79 wayland: Add a cogl_wayland_onscreen_resize function
This function will call into the Wayland EGL platform API and resize the
surface that the window is using and update the internal dimensions for
framebuffer and viewport to reflect the change.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-01-13 13:56:12 +00:00
Neil Roberts
cbbac5a2f5 Add a feature ID for the swap event notification
Previously the swap event notification feature was only accessible as
a winsys feature using the semi-internal
cogl_clutter_winsys_has_feature. This just adds a feature ID for it so
it can also be accessed via cogl_has_feature.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-01-09 18:59:59 +00:00
Robert Bragg
3bc70687ac Remove old fallback for vblank wait via manual drm ioctl
This workaround code has just been incrementally carried forward since
Cogl was integrated with Clutter but really we have no idea when this
code path was ever tested. Since the work around is from before the time
of the current Cogl developers we don't know anything about the
circumstances which led to this extreme workaround instead of pushing to
fix a driver.

It seems pretty likely we can push to fix any drm based drivers so
we're removing the workaround.

https://bugzilla.gnome.org/show_bug.cgi?id=667009

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2012-01-05 20:31:09 +00:00
Neil Roberts
181b875a3d xlib: Internally retrieve XEvents
Previously we relied on the application to send all X events through
Cogl using cogl_xlib_renderer_handle_event. This breaks the
abstraction that an application shouldn't need to know what winsys
Cogl is using. Now that we have main loop integreation in Cogl, the
Xlib-based winsys's can report that Cogl needs to block on the file
descriptor of the X connection and it can manually handle the
events.

The event retrieval can be disabled by an application if it calls the
new cogl_xlib_renderer_set_event_retrieval_enabled() function. The
event retrieval will also automatically be disabled if the application
sets a foreign display.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-01-05 13:40:24 +00:00
Neil Roberts
7497475295 Add support for main loop integration
This adds two new functions:

void
cogl_poll_get_info (CoglContext *context,
                    CoglPollFD **poll_fds,
                    int *n_poll_fds,
                    gint64 *timeout);

void
cogl_poll_dispatch (CoglContext *context,
                    const CoglPollFD *poll_fds,
                    int n_poll_fds);

The application is expected to call the first function whenever it is
about to block to go idle, and the second function whenever it comes
out of idle. This gives Cogl winsys's the ability poll file
descriptors for events. For example when handing swap complete
notifications, it can report that it needs to block on a file
descriptor.

The two functions are backed by winsys virtual functions. There are
currently no implementations. The default handler for get_info just
reports no file descriptors and an infinite timeout.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2012-01-05 13:40:10 +00:00
Neil Roberts
24fe7c300c cogl-texture-pixmap-x11: Fix the foreach_sub_texture_in_region impl
The foreach_sub_texture_in_region implementation tries to forward the
function on to its child texture but it was mistakenly forwarding back
on to itself so it would just recurse endlessly and crash.
2011-12-20 12:46:50 +00:00
Neil Roberts
bdcbb8af4d Update the SDL winsys
The SDL winsys was missing a few minor features, such as the
implementation. This patch adds that in.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-12-14 16:45:17 +00:00
Neil Roberts
616d27f169 cogl-texture-2d: Fix checking for the EGL winsys
CoglTexture2D had an assert to verify that the EGL winsys was being
used. This doesn't make any sense any more because the EGL winsys
can't be used directly but instead it is just a base winsys for the
platform winsys's. To fix this this patch adds a set of 'criteria'
flags to each winsys, one of which is 'uses EGL'. CoglTexture2D can
use this to determine if the winsys is supported.

Eventually we might want to expose these flags publically so that an
application can select a winsys based on certain conditions. For
example, an application may need a winsys that uses X or EGL but
doesn't care exactly which one it is.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-12-14 16:41:16 +00:00
Neil Roberts
ff5bfc4a86 Rename the EGL_X11 winsys to EGL_XLIB
Eventually we might want to have an XCB-based EGL winsys. We already
have xlib-specific API in CoglRenderer (eg, to set a foreign display)
so the application needs to be able to specifically select between XCB
and XLIB.

This also removes the POWERVR part while renaming
COGL_HAS_EGL_PLATFORM_POWERVR_X11_SUPPORT to
COGL_HAS_EGL_PLATFORM_XLIB_SUPPORT because the winsys is equally
applicable to Mesa.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-12-14 16:40:26 +00:00
Neil Roberts
3a4dce0c53 Move the EGL Android winsys out of cogl-winsys-egl
This moves all of the code specific to the Android platform out of
cogl-winsys-egl. It is completely untested apart from that it
compiles using a dummy android/native_window.h header.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-12-13 16:08:37 +00:00
Neil Roberts
d70c764da6 Move the EGL GDL winsys out of cogl-winsys-egl
This moves all of the code specific to the gdl winsys out of
cogl-winsys-egl. It is completely untested apart from that it
compiles.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-12-13 16:08:37 +00:00
Neil Roberts
f1d831d644 Move the EGL null winsys out of cogl-winsys-egl
This moves all of the code specific to the null winsys out of
cogl-winsys-egl.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-12-13 13:12:17 +00:00
Neil Roberts
a6b1f55546 kms: Don't use egl_surface_width/height
The egl_surface_width/height properties in CoglDisplayEGL were
accidentally being conditionally defined depending on KMS
support. They are not necessary because CoglDisplayKMS also already
stores the width/height and this was just copied over to the EGL
dipslay.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-12-13 13:12:16 +00:00
Neil Roberts
4dbef01ec3 winsys: Move Wayland-specific code out of the EGL winsys
All of the Wayland-specific code now lives in the EGL_WAYLAND winsys.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-12-12 17:41:43 +00:00
Neil Roberts
613a3390da winsys: Move X11/Xlib-specific code out of the EGL winsys
All of the X11/Xlib-specific code now lives in the EGL_X11 winsys.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-12-12 16:14:19 +00:00
Neil Roberts
a72a2c99fe Don't bother trying to accept NULL in _cogl_winsys_onscreen_bind
The GLX and EGL winsys backends had a check for when onscreen==NULL
in which case they would instead try to bind the dummy surface. This
wouldn't work however because it would have already crashed by that
point when it tried to get the Cogl context out of the onscreen. The
function needs a bit of refactoring before it could support this but
presumably nothing is relying on this anyway because it wouldn't work
so for now we can just remove it.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-12-12 16:14:18 +00:00
Neil Roberts
7f74712a79 Remove CoglXlibDisplay
CoglXlibDisplay just contained one member called dummy_xwin. This was
not shared outside of the respective winsys's so I don't think it
really makes sense to have a separate shared struct for it. It seems
more like an implementation detail that is specific to the winsys
because for example it may be that the EGL winsys could use the
surfaceless extension and not bother with a dummy window. This will
also make it easier to factor out the Xlib-specific data in
CoglDisplayEGL to the platform data.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-12-12 16:14:18 +00:00
Neil Roberts
a8f84af776 cogl-xlib-renderer: Move private data to cogl_object_set_user_data
Previously the Xlib renderer data was meant to be the first member of
whatever the winsys data is. This doesn't work well for the EGL winsys
because it only needs the Xlib data if the X11 platform is used. The
Xlib renderer data is now instead created on demand and connected to
the object using cogl_object_set_user_data. There is a new function to
get access to it.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-12-12 16:13:57 +00:00
Neil Roberts
dd75926c1a egl: Split out the KMS winsys as overrides of the EGL winsys
Instead of having #ifdefs to hook into the normal EGL winsys, the KMS
winsys now overrides any winsys functions that it wants. Where the
winsys wants to hook into a point within a function provided by the
EGL winsys there is a EGL-platform vtable which gets set on the EGL
renderer data during renderer_connect. The KMS-specific data on all of
the structures is now allocated separately by the KMS winsys and is
pointed to by a new 'platform' pointer in the EGL data.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-12-09 17:29:49 +00:00
Neil Roberts
93e6e2051f egl: Allow multiple EGL platforms
The #ifdefs in cogl-winsys-egl have been changed so that they
additionally check renderer->winsys_vtable->id for the corresponding
winsys ID so that multiple EGL platforms can be enabled.

The is a stop-gap solution until we can move all of the EGL platforms
into their own winsys files with overrides of the EGL vtable. However
with this approach we can move one platform at a time which will make
it easier.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-12-08 19:16:41 +00:00
Neil Roberts
a1e1527b69 Add a separate winsys vtable for each EGL platform
Instead of just having an "EGL" renderer, there is now a separate
winsys for each platform. Currently they just directly copy the vtable
for the EGL platform so it is still only possible to have one EGL
platform compiled into Cogl. However the intention is that the
winsys-specific code for each platform will be moved into override
functions in the corresponding platform winsys.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-12-08 17:38:25 +00:00
Rob Bradford
590e1c46f0 wayland: Add API to access the shell surface for the onscreen
Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-12-08 16:21:57 +00:00
Rob Bradford
4928ca5a90 wayland: Port to latest Wayland API (to wl_surface_shell)
Requests for the shell to manipulate it's state for the surface are now
abstracted through a wl_shell_surface object rather through wl_shell as
before.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-12-08 16:19:50 +00:00
Neil Roberts
889e4aba9c kms: Check for the right surfaceless extension depending on driver
There are three separate EGL_KHR_surfaceless_* extensions depending on
which GL API is being used so we should probably check the right one
depending on which driver Cogl has selected.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-12-08 12:48:59 +00:00
Neil Roberts
7adf7c5e38 kms: Fix GLES2 support
There were two problems stopping the KMS winsys from working with a
GLES2 driver:

• When creating the EGL context, it was missing the attribute to
  select the client version so it would end up with the GLES1 API.

• When creating the depth buffer for the framebuffer it was using
  GL_DEPTH_COMPONENT but only GL_DEPTH_COMPONENT16 is supported on
  GLES. cogl-framebuffer already unconditionally uses this so it
  probably makes sense to do the same here.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-12-08 12:48:59 +00:00
Robert Bragg
79f20d08b6 wayland: Updates the wayland compositor side support
The compositor side wayland support enabling us to create textures from
wayland buffers needed updating since visuals were removed from the
wayland protocol.

This also fixes the #ifdef guards for the bind_wayland_display extension
in cogl-winsys-egl-feature-functions.h since it was mistakenly checking
that client-side wayland support had been enabled which won't be the
case.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2011-12-07 15:53:05 +00:00