st/egl_g3d: Update the native display interface for modesetting.
The new interface can be used to implement EGL_MESA_screen_surface. Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
This commit is contained in:
@@ -84,8 +84,23 @@ struct native_config {
|
||||
enum pipe_format color_format;
|
||||
enum pipe_format depth_format;
|
||||
enum pipe_format stencil_format;
|
||||
|
||||
/* treat it as an additional flag to mode.drawableType */
|
||||
boolean scanout_bit;
|
||||
};
|
||||
|
||||
struct native_connector {
|
||||
int dummy;
|
||||
};
|
||||
|
||||
struct native_mode {
|
||||
const char *desc;
|
||||
int width, height;
|
||||
int refresh_rate;
|
||||
};
|
||||
|
||||
struct native_display_modeset;
|
||||
|
||||
/**
|
||||
* A pipe winsys abstracts the OS. A pipe screen abstracts the graphcis
|
||||
* hardware. A native display consists of a pipe winsys, a pipe screen, and
|
||||
@@ -136,23 +151,51 @@ struct native_display {
|
||||
const struct native_config *nconf,
|
||||
uint width, uint height);
|
||||
|
||||
#if 0
|
||||
struct native_mode *(*get_modes)(struct native_display *ndpy,
|
||||
int *num_modes);
|
||||
|
||||
/**
|
||||
* Create a screen surface.
|
||||
*/
|
||||
struct native_surface *(*create_screen_surface)(struct native_display *ndpy,
|
||||
const struct native_config *nconf,
|
||||
uint width, uint height);
|
||||
|
||||
boolean (*set_mode)(struct native_display *ndpy,
|
||||
const struct native_mode *nmode,
|
||||
struct native_surface *nsurf);
|
||||
#endif
|
||||
const struct native_display_modeset *modeset;
|
||||
};
|
||||
|
||||
/**
|
||||
* Mode setting interface of the native display. It exposes the mode setting
|
||||
* capabilities of the underlying graphics hardware.
|
||||
*/
|
||||
struct native_display_modeset {
|
||||
/**
|
||||
* Get the available physical connectors and the number of CRTCs.
|
||||
*/
|
||||
const struct native_connector **(*get_connectors)(struct native_display *ndpy,
|
||||
int *num_connectors,
|
||||
int *num_crtcs);
|
||||
|
||||
/**
|
||||
* Get the current supported modes of a connector. The returned modes may
|
||||
* change every time this function is called and those from previous calls
|
||||
* might become invalid.
|
||||
*/
|
||||
const struct native_mode **(*get_modes)(struct native_display *ndpy,
|
||||
const struct native_connector *nconn,
|
||||
int *num_modes);
|
||||
|
||||
/**
|
||||
* Create a scan-out surface. Required unless no config has
|
||||
* GLX_SCREEN_BIT_MESA set.
|
||||
*/
|
||||
struct native_surface *(*create_scanout_surface)(struct native_display *ndpy,
|
||||
const struct native_config *nconf,
|
||||
uint width, uint height);
|
||||
|
||||
/**
|
||||
* Program the CRTC to output the surface to the given connectors with the
|
||||
* given mode. When surface is not given, the CRTC is disabled.
|
||||
*
|
||||
* This interface does not export a way to query capabilities of the CRTCs.
|
||||
* The native display usually needs to dynamically map the index to a CRTC
|
||||
* that supports the given connectors.
|
||||
*/
|
||||
boolean (*program)(struct native_display *ndpy, int crtc_idx,
|
||||
struct native_surface *nsurf, uint x, uint y,
|
||||
const struct native_connector **nconns, int num_nconns,
|
||||
const struct native_mode *nmode);
|
||||
};
|
||||
|
||||
typedef void (*native_flush_frontbuffer)(void *dummy,
|
||||
struct pipe_surface *surf,
|
||||
|
||||
Reference in New Issue
Block a user