gallium: replace INLINE with inline
[mesa.git] / src / gallium / state_trackers / dri / dri_screen.h
index e9944e0f63e20e35934ce18f06bbc53910363a85..6d46fea9684c0e91235bc13328efc63f0503953e 100644 (file)
 #include "pipe/p_context.h"
 #include "pipe/p_state.h"
 #include "state_tracker/st_api.h"
+#include "state_tracker/opencl_interop.h"
+#include "os/os_thread.h"
+#include "postprocess/filters.h"
+
+struct dri_context;
+struct dri_drawable;
+struct pipe_loader_device;
 
 struct dri_screen
 {
+   /* st_api */
+   struct st_manager base;
+   struct st_api *st_api;
+
+   /* on old libGL's invalidate doesn't get called as it should */
+   boolean broken_invalidate;
+
    /* dri */
    __DRIscreen *sPriv;
+   boolean throttling_enabled;
+   int default_throttle_frames;
 
-   /**
-    * Configuration cache with default values for all contexts
-    */
+   /** Configuration cache with default values for all contexts */
+   driOptionCache optionCacheDefaults;
+
+   /** The screen's effective configuration options */
    driOptionCache optionCache;
 
+   struct st_config_options options;
+
+   /* Which postprocessing filters are enabled. */
+   unsigned pp_enabled[PP_FILTERS];
+
    /* drm */
    int fd;
-   drmLock *drmLock;
+   boolean can_share_buffer;
+
+   struct pipe_loader_device *dev;
 
    /* gallium */
-   struct drm_api *api;
-   struct pipe_winsys *pipe_winsys;
-   struct pipe_screen *pipe_screen;
    boolean d_depth_bits_last;
    boolean sd_depth_bits_last;
    boolean auto_fake_front;
+   boolean has_reset_status_query;
+   enum pipe_texture_target target;
 
-   struct st_manager *smapi;
+   /* hooks filled in by dri2 & drisw */
+   __DRIimage * (*lookup_egl_image)(struct dri_screen *ctx, void *handle);
 
-   /* used only by DRI1 */
-   struct pipe_context *dri1_pipe;
+   /* OpenCL interop */
+   pipe_mutex opencl_func_mutex;
+   opencl_dri_event_add_ref_t opencl_dri_event_add_ref;
+   opencl_dri_event_release_t opencl_dri_event_release;
+   opencl_dri_event_wait_t opencl_dri_event_wait;
+   opencl_dri_event_get_fence_t opencl_dri_event_get_fence;
 };
 
 /** cast wrapper */
-static INLINE struct dri_screen *
+static inline struct dri_screen *
 dri_screen(__DRIscreen * sPriv)
 {
-   return (struct dri_screen *)sPriv->private;
+   return (struct dri_screen *)sPriv->driverPrivate;
 }
 
-extern const uint __driNConfigOptions;
+struct __DRIimageRec {
+   struct pipe_resource *texture;
+   unsigned level;
+   unsigned layer;
+   uint32_t dri_format;
+   uint32_t dri_components;
 
-const __DRIconfig **
-dri_fill_in_modes(struct dri_screen *screen, unsigned pixel_bits);
+   void *loader_private;
+
+   /**
+    * Provided by EGL_EXT_image_dma_buf_import.
+    */
+   enum __DRIYUVColorSpace yuv_color_space;
+   enum __DRISampleRange sample_range;
+   enum __DRIChromaSiting horizontal_siting;
+   enum __DRIChromaSiting vertical_siting;
+
+};
+
+#ifndef __NOT_HAVE_DRM_H
+
+static inline boolean
+dri_with_format(__DRIscreen * sPriv)
+{
+   const __DRIdri2LoaderExtension *loader = sPriv->dri2.loader;
+
+   return loader
+       && (loader->base.version >= 3)
+       && (loader->getBuffersWithFormat != NULL);
+}
+
+#else
+
+static inline boolean
+dri_with_format(__DRIscreen * sPriv)
+{
+   return TRUE;
+}
+
+#endif
 
 void
 dri_fill_st_visual(struct st_visual *stvis, struct dri_screen *screen,
-                   const __GLcontextModes *mode);
+                   const struct gl_config *mode);
+
+const __DRIconfig **
+dri_init_screen_helper(struct dri_screen *screen,
+                       struct pipe_screen *pscreen,
+                       const char* driver_name);
+
+void
+dri_destroy_screen_helper(struct dri_screen * screen);
+
+void
+dri_destroy_screen(__DRIscreen * sPriv);
+
+extern struct pipe_screen *kms_swrast_create_screen(int fd);
+extern const struct __DriverAPIRec dri_kms_driver_api;
+
+extern const struct __DriverAPIRec galliumdrm_driver_api;
+extern const __DRIextension *galliumdrm_driver_extensions[];
+extern const struct __DriverAPIRec galliumsw_driver_api;
+extern const __DRIextension *galliumsw_driver_extensions[];
+extern const __DRIconfigOptionsExtension gallium_config_options;
 
 #endif