android: nv50/ir: Add nv50_ir_prog_info_out serialize and deserialize
[mesa.git] / src / gallium / winsys / sw / dri / dri_sw_winsys.c
index eacee295ee1683a24c2b34de6a75454a09b630ec..f9ff6d25d730138c2dfc19d9354461d1607c6664 100644 (file)
 #ifdef HAVE_SYS_SHM_H
 #include <sys/ipc.h>
 #include <sys/shm.h>
+#ifdef __FreeBSD__
+/* sys/ipc.h -> sys/_types.h -> machine/param.h
+ * - defines ALIGN which clashes with our ALIGN
+ */
+#undef ALIGN
+#endif
 #endif
 
 #include "pipe/p_compiler.h"
 #include "pipe/p_format.h"
 #include "pipe/p_state.h"
 #include "util/u_inlines.h"
-#include "util/u_format.h"
+#include "util/format/u_format.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
 
-#include "state_tracker/sw_winsys.h"
+#include "frontend/sw_winsys.h"
 #include "dri_sw_winsys.h"
 
 
@@ -77,13 +83,13 @@ dri_sw_winsys( struct sw_winsys *ws )
 }
 
 
-static boolean
+static bool
 dri_sw_is_displaytarget_format_supported( struct sw_winsys *ws,
                                           unsigned tex_usage,
                                           enum pipe_format format )
 {
    /* TODO: check visuals or other sensible thing here */
-   return TRUE;
+   return true;
 }
 
 #ifdef HAVE_SYS_SHM_H
@@ -92,7 +98,8 @@ alloc_shm(struct dri_sw_displaytarget *dri_sw_dt, unsigned size)
 {
    char *addr;
 
-   dri_sw_dt->shmid = shmget(IPC_PRIVATE, size, IPC_CREAT|0777);
+   /* 0600 = user read+write */
+   dri_sw_dt->shmid = shmget(IPC_PRIVATE, size, IPC_CREAT | 0600);
    if (dri_sw_dt->shmid < 0)
       return NULL;
 
@@ -214,7 +221,7 @@ dri_sw_displaytarget_from_handle(struct sw_winsys *winsys,
    return NULL;
 }
 
-static boolean
+static bool
 dri_sw_displaytarget_get_handle(struct sw_winsys *winsys,
                                 struct sw_displaytarget *dt,
                                 struct winsys_handle *whandle)
@@ -223,12 +230,12 @@ dri_sw_displaytarget_get_handle(struct sw_winsys *winsys,
 
    if (whandle->type == WINSYS_HANDLE_TYPE_SHMID) {
       if (dri_sw_dt->shmid < 0)
-         return FALSE;
+         return false;
       whandle->handle = dri_sw_dt->shmid;
-      return TRUE;
+      return true;
    }
 
-   return FALSE;
+   return false;
 }
 
 static void