diff --git a/Doxyfile.procs b/Doxyfile.procs index e9228ce1..ac8eb359 100644 --- a/Doxyfile.procs +++ b/Doxyfile.procs @@ -2102,7 +2102,7 @@ PREDEFINED = _MGRM_PROCESSES \ _MGFONT_FT2 \ _MGFONT_UPF \ _MGFONT_BMPF \ - _MGGAL_DRI \ + _MGGAL_DRM \ _MGGAL_COMMLCD \ _MGIAL_COMM diff --git a/Doxyfile.sal b/Doxyfile.sal index 41889588..ff8d9936 100644 --- a/Doxyfile.sal +++ b/Doxyfile.sal @@ -2102,7 +2102,7 @@ PREDEFINED = _MGRM_STANDALONE \ _MGFONT_FT2 \ _MGFONT_UPF \ _MGFONT_BMPF \ - _MGGAL_DRI \ + _MGGAL_DRM \ _MGGAL_COMMLCD \ _MGIAL_COMM diff --git a/Doxyfile.ths b/Doxyfile.ths index 2bbfdf05..eee0de52 100644 --- a/Doxyfile.ths +++ b/Doxyfile.ths @@ -2102,7 +2102,7 @@ PREDEFINED = _MGRM_THREADS \ _MGFONT_FT2 \ _MGFONT_UPF \ _MGFONT_BMPF \ - _MGGAL_DRI \ + _MGGAL_DRM \ _MGGAL_COMMLCD \ _MGIAL_COMM diff --git a/configure.ac b/configure.ac index 7602fda2..951b5f8b 100644 --- a/configure.ac +++ b/configure.ac @@ -264,7 +264,7 @@ enable_video_dfb="no" enable_video_dfb_st7167="no" enable_video_stgfb="no" -enable_video_dri="yes" +enable_video_drm="yes" enable_video_fbcon="no" enable_video_commlcd="no" enable_video_shadow="no" @@ -886,24 +886,24 @@ dnl Find the DRM includes CheckDRM() { if test "x$runtime_mode" = "xprocs"; then - enable_video_dri="no; DRI engine does not support MiniGUI-Processes runtime mode currently" + enable_video_drm="no; DRI engine does not support MiniGUI-Processes runtime mode currently" else - AC_ARG_ENABLE(videodri, - [ --enable-videodri include Linux DRI NEWGAL engine ], - enable_video_dri=$enableval) - if test "x$enable_video_dri" = "xyes"; then - PKG_CHECK_MODULES(DRM, [libdrm >= 2.4], video_dri="yes", - video_dri="no; Linux DRI NEWGAL engine requires libdrm 2.4+") - if test "x$video_dri" = "xyes"; then - AC_DEFINE(_MGGAL_DRI, 1, + AC_ARG_ENABLE(videodrm, + [ --enable-videodrm include Linux DRI NEWGAL engine ], + enable_video_drm=$enableval) + if test "x$enable_video_drm" = "xyes"; then + PKG_CHECK_MODULES(DRM, [libdrm >= 2.4], video_drm="yes", + video_drm="no; Linux DRI NEWGAL engine requires libdrm 2.4+") + if test "x$video_drm" = "xyes"; then + AC_DEFINE(_MGGAL_DRM, 1, [Define if include Linux DRI NEWGAL engine]) - VIDEO_SUBDIRS="$VIDEO_SUBDIRS dri" - VIDEO_DRIVERS="$VIDEO_DRIVERS dri/libvideo_dri.la" - DEP_LIBS="$DEP_LIBS -ldrm" + VIDEO_SUBDIRS="$VIDEO_SUBDIRS drm" + VIDEO_DRIVERS="$VIDEO_DRIVERS drm/libvideo_drm.la" + DEP_LIBS="$DEP_LIBS -ldrm -ldl" DRM_INC_DIR="`$PKG_CONFIG --variable includedir libdrm`/libdrm" AC_SUBST(DRM_INC_DIR) else - AC_MSG_WARN([$video_dri]) + AC_MSG_WARN([$video_drm]) fi fi fi @@ -2636,7 +2636,7 @@ src/font/Makefile src/font/in-core/Makefile src/newgal/Makefile src/newgal/fbcon/Makefile -src/newgal/dri/Makefile +src/newgal/drm/Makefile src/newgal/qvfb/Makefile src/newgal/pcxvfb/Makefile src/newgal/wvfb/Makefile @@ -2713,7 +2713,7 @@ AC_MSG_NOTICE([ * dummy: ${enable_video_dummy} * pc_xvfb: ${enable_video_pc_xvfb} * usvfb: ${enable_video_usvfb} - * dri: ${enable_video_dri} + * drm: ${enable_video_drm} * fbcon: ${enable_video_fbcon} * commlcd: ${enable_video_commlcd} diff --git a/etc/MiniGUI.cfg b/etc/MiniGUI.cfg index b7db84de..78d17c68 100644 --- a/etc/MiniGUI.cfg +++ b/etc/MiniGUI.cfg @@ -36,8 +36,8 @@ mtype=IMPS2 # Linux IAL engine based on libinput # ial_engine=libinut -#{{ifdef _MGGAL_DRI -[dri] +#{{ifdef _MGGAL_DRM +[drm] defaultmode=1024x768-32bpp # We use DRM fourcc code to defined the pixel format of the video surface. diff --git a/include/exstubs.h b/include/exstubs.h index 3bc9f898..182be4e1 100644 --- a/include/exstubs.h +++ b/include/exstubs.h @@ -76,7 +76,7 @@ extern "C" { #endif /* __cplusplus */ -#ifdef _MGGAL_DRI +#ifdef _MGGAL_DRM /** * \defgroup external_stubs_dri External Stubs for DRI sub driver @@ -88,14 +88,14 @@ extern "C" { * The struct type represents the DRI sub driver. * The concrete struct should be defined by the driver. */ -struct _DriDriver; -typedef struct _DriDriver DriDriver; +struct _DrmDriver; +typedef struct _DrmDriver DrmDriver; /** * The struct type represents the bufffer can be used by * MiniGUI NEWGAL engine for hardware surface. */ -typedef struct _DriSurfaceBuffer { +typedef struct _DrmSurfaceBuffer { /** The handle of the buffer */ uint32_t handle; /** The buffer identifier */ @@ -120,12 +120,12 @@ typedef struct _DriSurfaceBuffer { unsigned long size; /** The mapped address of the buffer; NULL when the buffer is not mapped yet. */ uint8_t* pixels; -} DriSurfaceBuffer; +} DrmSurfaceBuffer; /** * The color logic operations. */ -enum DriColorLogicOp { +enum DrmColorLogicOp { COLOR_LOGICOP_CLEAR = 0, COLOR_LOGICOP_NOR = 1, COLOR_LOGICOP_AND_INVERTED = 2, @@ -147,70 +147,70 @@ enum DriColorLogicOp { /** * The struct type defines the operations for a DRI driver. */ -typedef struct _DriDriverOps { +typedef struct _DrmDriverOps { /** - * This operation creates the DriDriver object. + * This operation creates the DrmDriver object. * * \note The driver must implement this operation. */ - DriDriver* (*create_driver) (int device_fd); + DrmDriver* (*create_driver) (int device_fd); /** - * This operation destroies the DriDriver object. + * This operation destroies the DrmDriver object. * * \note The driver must implement this operation. */ - void (*destroy_driver) (DriDriver *driver); + void (*destroy_driver) (DrmDriver *driver); /** * This operation flushs the batch buffer of the driver or the hardware cache. * * \note This operation can be NULL. */ - void (* flush_driver) (DriDriver *driver); + void (* flush_driver) (DrmDriver *driver); /** * This operation creates a buffer with the specified pixel format, - * width, and height. If succeed, a valid DriSurfaceBuffer object will + * width, and height. If succeed, a valid DrmSurfaceBuffer object will * be returned; NULL on error. Note that the field of `pixels` of the - * DriSurfaceBuffer object is NULL until the \a map_buffer was called. + * DrmSurfaceBuffer object is NULL until the \a map_buffer was called. * * \note The driver must implement this operation. */ - DriSurfaceBuffer* (* create_buffer) (DriDriver *driver, + DrmSurfaceBuffer* (* create_buffer) (DrmDriver *driver, uint32_t drm_format, unsigned int width, unsigned int height); /** * This operation creates a buffer for the given handle * with the specified pixel format, width, and height. If succeed, - * a valid DriSurfaceBuffer object will be returned; NULL on error. + * a valid DrmSurfaceBuffer object will be returned; NULL on error. * * \note This operation can be NULL. */ - DriSurfaceBuffer* (* create_buffer_from_handle) (DriDriver *driver, + DrmSurfaceBuffer* (* create_buffer_from_handle) (DrmDriver *driver, uint32_t handle, unsigned long size, uint32_t drm_format, unsigned int width, unsigned int height, unsigned int pitch); /** * This operation creates a buffer for the given system global name * with the specified pixel format, width, and height. If succeed, - * a valid DriSurfaceBuffer object will be returned; NULL on error. + * a valid DrmSurfaceBuffer object will be returned; NULL on error. * * \note This operation can be NULL. */ - DriSurfaceBuffer* (* create_buffer_from_name) (DriDriver *driver, + DrmSurfaceBuffer* (* create_buffer_from_name) (DrmDriver *driver, uint32_t name, uint32_t drm_format, unsigned int width, unsigned int height, unsigned int pitch); /** * This operation creates a buffer for the given PRIME file descriptor * with the specified pixel format, width, height, and pitch. If succeed, - * a valid DriSurfaceBuffer object will be returned; NULL on error. + * a valid DrmSurfaceBuffer object will be returned; NULL on error. * * \note This operation can be NULL. */ - DriSurfaceBuffer* (* create_buffer_from_prime_fd) (DriDriver *driver, + DrmSurfaceBuffer* (* create_buffer_from_prime_fd) (DrmDriver *driver, int prime_fd, unsigned long size, uint32_t drm_format, unsigned int width, unsigned int height, unsigned int pitch); @@ -220,21 +220,21 @@ typedef struct _DriDriverOps { * * \note The driver must implement this operation. */ - uint8_t* (* map_buffer) (DriDriver *driver, DriSurfaceBuffer* buffer); + uint8_t* (* map_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer); /** * This operation un-maps a buffer. * * \note The driver must implement this operation. */ - void (* unmap_buffer) (DriDriver *driver, DriSurfaceBuffer* buffer); + void (* unmap_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer); /** * This operation destroies a buffer. * * \note The driver must implement this operation. */ - void (* destroy_buffer) (DriDriver *driver, DriSurfaceBuffer* buffer); + void (* destroy_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer); /** * This operation clears the specific rectangle area of a buffer @@ -243,8 +243,8 @@ typedef struct _DriDriverOps { * \note If this operation is set as NULL, the driver does not support * hardware accelerated clear operation. */ - int (* clear_buffer) (DriDriver *driver, - DriSurfaceBuffer* dst_buf, const GAL_Rect* rc, uint32_t pixel_value); + int (* clear_buffer) (DrmDriver *driver, + DrmSurfaceBuffer* dst_buf, const GAL_Rect* rc, uint32_t pixel_value); /** * This operation checks whether a hardware accelerated blit @@ -254,8 +254,8 @@ typedef struct _DriDriverOps { * \note If this operation is set as NULL, it will be supposed that * the driver does not support any hardware accelerated blit operation. */ - int (* check_blit) (DriDriver *driver, - DriSurfaceBuffer* src_buf, DriSurfaceBuffer* dst_buf); + int (* check_blit) (DrmDriver *driver, + DrmSurfaceBuffer* src_buf, DrmSurfaceBuffer* dst_buf); /** * This operation copies bits from a source buffer to a destination buffer. @@ -263,10 +263,10 @@ typedef struct _DriDriverOps { * \note If this operation is set as NULL, the driver does not support * hardware accelerated copy blit. */ - int (* copy_blit) (DriDriver *driver, - DriSurfaceBuffer* src_buf, const GAL_Rect* src_rc, - DriSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc, - enum DriColorLogicOp logic_op); + int (* copy_blit) (DrmDriver *driver, + DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc, + DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc, + enum DrmColorLogicOp logic_op); /** * This operation blits pixles from a source buffer with the source alpha value @@ -275,9 +275,9 @@ typedef struct _DriDriverOps { * \note If this operation is set as NULL, the driver does not support * hardware accelerated blit with alpha. */ - int (* alpha_blit) (DriDriver *driver, - DriSurfaceBuffer* src_buf, const GAL_Rect* src_rc, - DriSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc, uint8_t alpha); + int (* alpha_blit) (DrmDriver *driver, + DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc, + DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc, uint8_t alpha); /** * This operation blits pixles from a source buffer to a destination buffer, @@ -286,9 +286,9 @@ typedef struct _DriDriverOps { * \note If this operation is set as NULL, the driver does not support * hardware accelerated blit with color key. */ - int (* key_blit) (DriDriver *driver, - DriSurfaceBuffer* src_buf, const GAL_Rect* src_rc, - DriSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc, uint32_t color_key); + int (* key_blit) (DrmDriver *driver, + DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc, + DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc, uint32_t color_key); /** * This operation blits pixles from a source buffer with the source alpha value @@ -297,19 +297,19 @@ typedef struct _DriDriverOps { * \note If this operation is set as NULL, the driver does not support * hardware accelerated blit with alpha and color key. */ - int (* alpha_key_blit) (DriDriver *driver, - DriSurfaceBuffer* src_buf, const GAL_Rect* src_rc, - DriSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc, + int (* alpha_key_blit) (DrmDriver *driver, + DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc, + DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc, uint8_t alpha, uint32_t color_key); -} DriDriverOps; +} DrmDriverOps; /** Implement this stub to return the DRI driver operations */ -DriDriverOps* __dri_ex_driver_get (const char* driver_name, int device_fd); +DrmDriverOps* __dri_ex_driver_get (const char* driver_name, int device_fd); /** @} end of external_stubs_dri */ -#endif /* _MGGAL_DRI */ +#endif /* _MGGAL_DRM */ #ifdef _MGGAL_COMMLCD diff --git a/include/gdi.h b/include/gdi.h index d94a17db..9b2120d7 100644 --- a/include/gdi.h +++ b/include/gdi.h @@ -13700,19 +13700,19 @@ MG_EXPORT int GUIAPI SetUserCompositionOps (HDC hdc, */ MG_EXPORT GHANDLE GetVideoHandle (HDC hdc); -#ifdef _MGGAL_DRI +#ifdef _MGGAL_DRM /** - * \defgroup gdi_dri_fns Functions for Linux DRI integration + * \defgroup gdi_drm_fns Functions for Linux DRM integration * - * These functions can be used to get the DRI device file descriptor and the + * These functions can be used to get the DRM device file descriptor and the * information of the hardware surface corresponding to the DC which is - * created by the Linux DRI engine. By using the information, we can + * created by the Linux DRM engine. By using the information, we can * integrate MiniGUI with other graphics libraries, such as Cairo * (vector graphics) and Mesa (3D graphics). * - * \note Only available when support for Linuxe DRI NEWGAL engine - * (`_MGGAL_DRI`) is enabled. + * \note Only available when support for Linuxe DRM NEWGAL engine + * (`_MGGAL_DRM`) is enabled. * * Since 4.0.4 * @@ -13720,20 +13720,20 @@ MG_EXPORT GHANDLE GetVideoHandle (HDC hdc); */ /** - * This function gets the file descriptor opened by the Linux DRI engine. + * This function gets the file descriptor opened by the Linux DRM engine. * * \param video The video handle returned by \a GetVideoHandle. * - * \return The DRI device file descriptor opened by the Linux DRI engine; + * \return The DRM device file descriptor opened by the Linux DRM engine; * >= 0 for success and < 0 on error. If \a surface is not a hardware - * surface created by the DRI engine, this function returns -1. + * surface created by the DRM engine, this function returns -1. */ -MG_EXPORT int driGetDeviceFD (GHANDLE video); +MG_EXPORT int drmGetDeviceFD (GHANDLE video); /** - * THe struct type defines the DRI surface information. + * THe struct type defines the DRM surface information. */ -typedef struct _DriSurfaceInfo { +typedef struct _DrmSurfaceInfo { /** The local handle of the buffer object. */ uint32_t handle; /** The buffer identifier. */ @@ -13748,75 +13748,75 @@ typedef struct _DriSurfaceInfo { uint32_t drm_format; /** Size in bytes of the buffer object. */ unsigned long size; -} DriSurfaceInfo; +} DrmSurfaceInfo; /** - * This function gets the DRI surface information from the handle of the surface. + * This function gets the DRM surface information from the handle of the surface. * * \param surface The handle to the surface. - * \param info The pointer to a DriSurfaceInfo structure to hold + * \param info The pointer to a DrmSurfaceInfo structure to hold * the surface information. * * \return TRUE for success, FALSE for failure. */ -MG_EXPORT BOOL driGetSurfaceInfo (GHANDLE video, HDC hdc, DriSurfaceInfo* info); +MG_EXPORT BOOL drmGetSurfaceInfo (GHANDLE video, HDC hdc, DrmSurfaceInfo* info); /** - * This function creates a memory DC with a DRI surface which is created by + * This function creates a memory DC with a DRM surface which is created by * a foreign process and identified by a global name handle. * * \param video The video handle. - * \param name The name handle of the DRI surface. + * \param name The name handle of the DRM surface. * \param drm_format The DRM pixel format. - * \param width The width of the DRI surface. - * \param height The height of the DRI surface. - * \param pitch The pitch (row stride) of the DRI surface. + * \param width The width of the DRM surface. + * \param height The height of the DRM surface. + * \param pitch The pitch (row stride) of the DRM surface. * * \return The handle to the memory DC for success, HDC_INVALID for failure. */ -MG_EXPORT HDC driCreateDCFromName (GHANDLE video, +MG_EXPORT HDC drmCreateDCFromName (GHANDLE video, uint32_t name, uint32_t drm_format, unsigned int width, unsigned int height, uint32_t pitch); /** - * This function creates a memory DC with a DRI surface which is created by + * This function creates a memory DC with a DRM surface which is created by * a foreign process and identified by a PRIME file descriptor. * * \param video The video handle. * \param prime_fd The PRIME file descriptor. - * \param size The size of the DRI surface in bytes. + * \param size The size of the DRM surface in bytes. * \param drm_format The DRM pixel format. - * \param width The width of the DRI surface. - * \param height The height of the DRI surface. - * \param pitch The pitch (row stride) of the DRI surface. + * \param width The width of the DRM surface. + * \param height The height of the DRM surface. + * \param pitch The pitch (row stride) of the DRM surface. * * \return The handle to the memory DC for success, HDC_INVALID for failure. */ -MG_EXPORT HDC driCreateDCFromPrimeFd (GHANDLE video, +MG_EXPORT HDC drmCreateDCFromPrimeFd (GHANDLE video, int prime_fd, unsigned long size, uint32_t drm_format, unsigned int width, unsigned int height, uint32_t pitch); /** - * This function creates a memory DC with a DRI surface which is created by + * This function creates a memory DC with a DRM surface which is created by * a foreign graphics component. * * \param video The video handle. - * \param handle The handle of the DRI surface. - * \param size The size of the DRI surface in bytes. + * \param handle The handle of the DRM surface. + * \param size The size of the DRM surface in bytes. * \param drm_format The DRM pixel format. - * \param width The width of the DRI surface. - * \param height The height of the DRI surface. - * \param pitch The pitch (row stride) of the DRI surface. + * \param width The width of the DRM surface. + * \param height The height of the DRM surface. + * \param pitch The pitch (row stride) of the DRM surface. * * \return The handle to the memory DC for success, HDC_INVALID for failure. */ -MG_EXPORT HDC driCreateDCFromHandle (GHANDLE video, +MG_EXPORT HDC drmCreateDCFromHandle (GHANDLE video, uint32_t handle, unsigned long size, uint32_t drm_format, unsigned int width, unsigned int height, uint32_t pitch); -/** @} end of gdi_dri_fns */ +/** @} end of gdi_drm_fns */ -#endif /* _MGGAL_DRI */ +#endif /* _MGGAL_DRM */ /** @} end of gdi_fns */ diff --git a/src/newgal/Makefile.am b/src/newgal/Makefile.am index 55e178d5..f63f4bd2 100644 --- a/src/newgal/Makefile.am +++ b/src/newgal/Makefile.am @@ -8,7 +8,7 @@ noinst_LTLIBRARIES = libnewgal.la SUBDIRS = @VIDEO_SUBDIRS@ DIST_SUBDIRS = dummy fbcon qvfb wvfb em85xxyuv em85xxosd svpxxosd bf533 utpmc \ mb93493 commlcd shadow mlshadow dfb em86gfx hisi rtos_xvfb pcxvfb \ - nexus s3c6410 sigma8654 mstar gdl stgfb usvfb dri + nexus s3c6410 sigma8654 mstar gdl stgfb usvfb drm # x11 dga vgl svga ggi aalib EXTRA_DIST=makefile.ng makefile.msvc diff --git a/src/newgal/dri/Makefile.am b/src/newgal/dri/Makefile.am deleted file mode 100644 index 7848ff9c..00000000 --- a/src/newgal/dri/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ - -## Makefile.am for the dri video driver -AM_CPPFLAGS = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include -I$(abs_top_srcdir)/src/newgal/ -I$(DRM_INC_DIR) - -noinst_LTLIBRARIES = libvideo_dri.la - -# The dri video driver sources -SRC_FILES = \ - drivideo.c - -HDR_FILES= \ - drivideo.h - -libvideo_dri_la_SOURCES = $(SRC_FILES) $(HDR_FILES) - -EXTRA_DIST=makefile.ng - -LIB_NAME=libvideo_dri diff --git a/src/newgal/drm/Makefile.am b/src/newgal/drm/Makefile.am new file mode 100644 index 00000000..d4d5c44c --- /dev/null +++ b/src/newgal/drm/Makefile.am @@ -0,0 +1,18 @@ + +## Makefile.am for the drm video driver +AM_CPPFLAGS = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include -I$(abs_top_srcdir)/src/newgal/ -I$(DRM_INC_DIR) + +noinst_LTLIBRARIES = libvideo_drm.la + +# The drm video driver sources +SRC_FILES = \ + drmvideo.c + +HDR_FILES= \ + drmvideo.h + +libvideo_drm_la_SOURCES = $(SRC_FILES) $(HDR_FILES) + +EXTRA_DIST=makefile.ng + +LIB_NAME=libvideo_drm diff --git a/src/newgal/dri/drivideo.c b/src/newgal/drm/drmvideo.c similarity index 90% rename from src/newgal/dri/drivideo.c rename to src/newgal/drm/drmvideo.c index 3239c652..9198a769 100644 --- a/src/newgal/dri/drivideo.c +++ b/src/newgal/drm/drmvideo.c @@ -50,7 +50,7 @@ #define _DEBUG #include "common.h" -#ifdef _MGGAL_DRI +#ifdef _MGGAL_DRM #include #include @@ -68,38 +68,38 @@ #include "exstubs.h" #include "pixels_c.h" -#include "drivideo.h" +#include "drmvideo.h" -#define DRI_DRIVER_NAME "dri" +#define DRM_DRIVER_NAME "drm" /* DRM engine methods for both dumb buffer and acclerated buffers */ -static int DRI_VideoInit(_THIS, GAL_PixelFormat *vformat); -static GAL_Rect **DRI_ListModes(_THIS, GAL_PixelFormat *format, Uint32 flags); -static int DRI_SetColors(_THIS, int firstcolor, int ncolors, GAL_Color *colors); -static void DRI_VideoQuit(_THIS); -static int DRI_Suspend(_THIS); -static int DRI_Resume(_THIS); +static int DRM_VideoInit(_THIS, GAL_PixelFormat *vformat); +static GAL_Rect **DRM_ListModes(_THIS, GAL_PixelFormat *format, Uint32 flags); +static int DRM_SetColors(_THIS, int firstcolor, int ncolors, GAL_Color *colors); +static void DRM_VideoQuit(_THIS); +static int DRM_Suspend(_THIS); +static int DRM_Resume(_THIS); /* DRM engine operators for dumb buffer */ -static GAL_Surface *DRI_SetVideoMode_Dumb(_THIS, GAL_Surface *current, +static GAL_Surface *DRM_SetVideoMode_Dumb(_THIS, GAL_Surface *current, int width, int height, int bpp, Uint32 flags); -static int DRI_AllocHWSurface_Dumb(_THIS, GAL_Surface *surface); -static void DRI_FreeHWSurface_Dumb(_THIS, GAL_Surface *surface); +static int DRM_AllocHWSurface_Dumb(_THIS, GAL_Surface *surface); +static void DRM_FreeHWSurface_Dumb(_THIS, GAL_Surface *surface); /* DRM engine operators accelerated */ -static GAL_Surface *DRI_SetVideoMode_Accl(_THIS, GAL_Surface *current, +static GAL_Surface *DRM_SetVideoMode_Accl(_THIS, GAL_Surface *current, int width, int height, int bpp, Uint32 flags); -static int DRI_AllocHWSurface_Accl(_THIS, GAL_Surface *surface); -static void DRI_FreeHWSurface_Accl(_THIS, GAL_Surface *surface); -static int DRI_CheckHWBlit_Accl(_THIS, GAL_Surface *src, GAL_Surface *dst); -static int DRI_FillHWRect_Accl(_THIS, GAL_Surface *dst, GAL_Rect *rect, +static int DRM_AllocHWSurface_Accl(_THIS, GAL_Surface *surface); +static void DRM_FreeHWSurface_Accl(_THIS, GAL_Surface *surface); +static int DRM_CheckHWBlit_Accl(_THIS, GAL_Surface *src, GAL_Surface *dst); +static int DRM_FillHWRect_Accl(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color); -static void DRI_UpdateRects_Accl (_THIS, int numrects, GAL_Rect *rects); -static int DRI_SetHWColorKey_Accl(_THIS, GAL_Surface *surface, Uint32 key); -static int DRI_SetHWAlpha_Accl(_THIS, GAL_Surface *surface, Uint8 value); +static void DRM_UpdateRects_Accl (_THIS, int numrects, GAL_Rect *rects); +static int DRM_SetHWColorKey_Accl(_THIS, GAL_Surface *surface, Uint32 key); +static int DRM_SetHWAlpha_Accl(_THIS, GAL_Surface *surface, Uint8 value); /* DRM driver bootstrap functions */ -static int DRI_Available(void) +static int DRM_Available(void) { return drmAvailable(); } @@ -136,7 +136,7 @@ struct drm_mode_info { * drm_prepare(). It resets the CRTCs to their saved states and deallocates * all memory. */ -static void drm_cleanup(DriVideoData* vdata) +static void drm_cleanup(DrmVideoData* vdata) { if (vdata->saved_crtc) { /* restore saved CRTC configuration */ @@ -200,7 +200,7 @@ static void drm_cleanup(DriVideoData* vdata) close (vdata->dev_fd); } -static void DRI_DeleteDevice(GAL_VideoDevice *device) +static void DRM_DeleteDevice(GAL_VideoDevice *device) { drm_cleanup(device->hidden); @@ -262,15 +262,15 @@ static char* find_driver_for_device (const char *dev_name) #define LEN_DRIVER_FILENAME 255 -static DriDriverOps* load_external_driver (DriVideoData* vdata, +static DrmDriverOps* load_external_driver (DrmVideoData* vdata, const char* driver_name, int device_fd) { const char* filename = NULL; char buff[LEN_DRIVER_FILENAME + 1]; - DriDriverOps* (*get_exdrv) (const char* driver_name, int device_fd); + DrmDriverOps* (*get_exdrv) (const char* driver_name, int device_fd); char* error; - filename = getenv ("MG_GAL_DRI_DRIVER"); + filename = getenv ("MG_GAL_DRM_DRIVER"); if (filename == NULL) { memset (buff, 0, sizeof (buff)); if (GetMgEtcValue ("dri", "exdriver", buff, LEN_DRIVER_FILENAME) < 0) @@ -281,13 +281,13 @@ static DriDriverOps* load_external_driver (DriVideoData* vdata, vdata->exdrv_handle = dlopen (filename, RTLD_LAZY); if (!vdata->exdrv_handle) { - _WRN_PRINTF("Failed to open specified external DRI driver: %s (%s)\n", + _WRN_PRINTF("Failed to open specified external DRM driver: %s (%s)\n", filename, dlerror()); return NULL; } dlerror(); /* Clear any existing error */ - get_exdrv = dlsym (vdata->exdrv_handle, "__dri_ex_driver_get"); + get_exdrv = dlsym (vdata->exdrv_handle, "__drm_ex_driver_get"); error = dlerror(); if (error) { _WRN_PRINTF("Failed to get symbol: %s\n", error); @@ -347,7 +347,7 @@ static int open_drm_device(GAL_VideoDevice *device) return 0; } -static GAL_VideoDevice *DRI_CreateDevice(int devindex) +static GAL_VideoDevice *DRM_CreateDevice(int devindex) { GAL_VideoDevice *device; @@ -379,53 +379,53 @@ static GAL_VideoDevice *DRI_CreateDevice(int devindex) return NULL; } - device->VideoInit = DRI_VideoInit; - device->ListModes = DRI_ListModes; - device->SetColors = DRI_SetColors; - device->VideoQuit = DRI_VideoQuit; + device->VideoInit = DRM_VideoInit; + device->ListModes = DRM_ListModes; + device->SetColors = DRM_SetColors; + device->VideoQuit = DRM_VideoQuit; if (device->hidden->driver) { /* Use accelerated driver */ - device->SetVideoMode = DRI_SetVideoMode_Accl; + device->SetVideoMode = DRM_SetVideoMode_Accl; #ifndef _MGRM_THREADS device->RequestHWSurface = NULL; #endif - device->AllocHWSurface = DRI_AllocHWSurface_Accl; - device->FreeHWSurface = DRI_FreeHWSurface_Accl; - device->UpdateRects = DRI_UpdateRects_Accl; + device->AllocHWSurface = DRM_AllocHWSurface_Accl; + device->FreeHWSurface = DRM_FreeHWSurface_Accl; + device->UpdateRects = DRM_UpdateRects_Accl; } else { /* Use DUMB buffer */ - device->SetVideoMode = DRI_SetVideoMode_Dumb; + device->SetVideoMode = DRM_SetVideoMode_Dumb; #ifndef _MGRM_THREADS device->RequestHWSurface = NULL; #endif - device->AllocHWSurface = DRI_AllocHWSurface_Dumb; - device->FreeHWSurface = DRI_FreeHWSurface_Dumb; + device->AllocHWSurface = DRM_AllocHWSurface_Dumb; + device->FreeHWSurface = DRM_FreeHWSurface_Dumb; device->UpdateRects = NULL; } - /* set accelerated methods in DRI_VideoInit */ + /* set accelerated methods in DRM_VideoInit */ device->CheckHWBlit = NULL; device->FillHWRect = NULL; device->SetHWColorKey = NULL; device->SetHWAlpha = NULL; - device->Suspend = DRI_Suspend; - device->Resume = DRI_Resume; - device->free = DRI_DeleteDevice; + device->Suspend = DRM_Suspend; + device->Resume = DRM_Resume; + device->free = DRM_DeleteDevice; return device; } -VideoBootStrap DRI_bootstrap = { - DRI_DRIVER_NAME, "Linux DRI video driver", - DRI_Available, DRI_CreateDevice +VideoBootStrap DRM_bootstrap = { + DRM_DRIVER_NAME, "Linux DRI video driver", + DRM_Available, DRM_CreateDevice }; /* * drm_find_crtc(vdata, res, conn, info): * This small helper tries to find a suitable CRTC for the given connector. */ -static int drm_find_crtc(DriVideoData* vdata, +static int drm_find_crtc(DrmVideoData* vdata, drmModeRes *res, drmModeConnector *conn, struct drm_mode_info *info) { drmModeEncoder *enc; @@ -506,7 +506,7 @@ static int drm_find_crtc(DriVideoData* vdata, * drm_setup_connector: * Set up a single connector. */ -static int drm_setup_connector(DriVideoData* vdata, +static int drm_setup_connector(DrmVideoData* vdata, drmModeRes *res, drmModeConnector *conn, struct drm_mode_info *info) { int ret; @@ -547,7 +547,7 @@ static int drm_setup_connector(DriVideoData* vdata, * drm_prepare: * Collect the connnectors and mode information. */ -static int drm_prepare(DriVideoData* vdata) +static int drm_prepare(DrmVideoData* vdata) { drmModeRes *res; drmModeConnector *conn; @@ -604,7 +604,7 @@ static int drm_prepare(DriVideoData* vdata) } /* DRM engine methods for both dumb buffer and acclerated buffers */ -static int DRI_VideoInit(_THIS, GAL_PixelFormat *vformat) +static int DRM_VideoInit(_THIS, GAL_PixelFormat *vformat) { int n = 0; struct drm_mode_info *iter; @@ -644,15 +644,15 @@ static int DRI_VideoInit(_THIS, GAL_PixelFormat *vformat) if (this->hidden->driver) { if (this->hidden->driver_ops->clear_buffer) { this->info.blit_fill = 1; - this->FillHWRect = DRI_FillHWRect_Accl; + this->FillHWRect = DRM_FillHWRect_Accl; } else this->FillHWRect = NULL; if (this->hidden->driver_ops->check_blit) { - this->CheckHWBlit = DRI_CheckHWBlit_Accl; - this->SetHWColorKey = DRI_SetHWColorKey_Accl; - this->SetHWAlpha = DRI_SetHWAlpha_Accl; + this->CheckHWBlit = DRM_CheckHWBlit_Accl; + this->SetHWColorKey = DRM_SetHWColorKey_Accl; + this->SetHWAlpha = DRM_SetHWAlpha_Accl; this->info.blit_hw = 1; if (this->hidden->driver_ops->alpha_blit) @@ -671,7 +671,7 @@ static int DRI_VideoInit(_THIS, GAL_PixelFormat *vformat) return(0); } -static GAL_Rect **DRI_ListModes(_THIS, GAL_PixelFormat *format, Uint32 flags) +static GAL_Rect **DRM_ListModes(_THIS, GAL_PixelFormat *format, Uint32 flags) { if (format->BitsPerPixel != 32) { return NULL; @@ -680,22 +680,22 @@ static GAL_Rect **DRI_ListModes(_THIS, GAL_PixelFormat *format, Uint32 flags) return this->hidden->modes; } -static int DRI_SetColors(_THIS, int firstcolor, int ncolors, GAL_Color *colors) +static int DRM_SetColors(_THIS, int firstcolor, int ncolors, GAL_Color *colors) { /* do nothing of note. */ return(1); } -static void DRI_VideoQuit(_THIS) +static void DRM_VideoQuit(_THIS) { if (this->screen->pixels != NULL) { this->screen->pixels = NULL; } } -static int DRI_Resume(_THIS) +static int DRM_Resume(_THIS) { - DriVideoData* vdata = this->hidden; + DrmVideoData* vdata = this->hidden; int ret = -1; _DBG_PRINTF ("NEWGAL>DRM: %s called\n", __FUNCTION__); @@ -718,9 +718,9 @@ static int DRI_Resume(_THIS) return ret; } -static int DRI_Suspend(_THIS) +static int DRM_Suspend(_THIS) { - DriVideoData* vdata = this->hidden; + DrmVideoData* vdata = this->hidden; int ret = -1; _DBG_PRINTF ("NEWGAL>DRM: %s called\n", __FUNCTION__); @@ -751,7 +751,7 @@ static int DRI_Suspend(_THIS) * Call this function to create a so called "dumb buffer". * We can use it for unaccelerated software rendering on the CPU. */ -static int drm_create_dumb_fb(DriVideoData* vdata, const DrmModeInfo* info, +static int drm_create_dumb_fb(DrmVideoData* vdata, const DrmModeInfo* info, uint32_t format, int bpp) { struct drm_mode_create_dumb creq; @@ -824,7 +824,7 @@ err_destroy: return ret; } -static DrmModeInfo* find_mode(DriVideoData* vdata, int width, int height) +static DrmModeInfo* find_mode(DrmVideoData* vdata, int width, int height) { DrmModeInfo *iter; @@ -1327,11 +1327,11 @@ static int translate_drm_format(uint32_t drm_format, Uint32* RGBAmasks) } /* DRM engine methods for dumb buffers */ -static GAL_Surface *DRI_SetVideoMode_Dumb(_THIS, GAL_Surface *current, +static GAL_Surface *DRM_SetVideoMode_Dumb(_THIS, GAL_Surface *current, int width, int height, int bpp, Uint32 flags) { uint32_t drm_format; - DriVideoData* vdata = this->hidden; + DrmVideoData* vdata = this->hidden; DrmModeInfo* info; Uint32 RGBAmasks[4]; int ret; @@ -1402,25 +1402,25 @@ static GAL_Surface *DRI_SetVideoMode_Dumb(_THIS, GAL_Surface *current, return(current); } -static int DRI_AllocHWSurface_Dumb(_THIS, GAL_Surface *surface) +static int DRM_AllocHWSurface_Dumb(_THIS, GAL_Surface *surface) { return(-1); } -static void DRI_FreeHWSurface_Dumb(_THIS, GAL_Surface *surface) +static void DRM_FreeHWSurface_Dumb(_THIS, GAL_Surface *surface) { surface->pixels = NULL; } /* DRM engine methods for accelerated buffers */ -static GAL_Surface *DRI_SetVideoMode_Accl(_THIS, GAL_Surface *current, +static GAL_Surface *DRM_SetVideoMode_Accl(_THIS, GAL_Surface *current, int width, int height, int bpp, Uint32 flags) { - DriVideoData* vdata = this->hidden; + DrmVideoData* vdata = this->hidden; DrmModeInfo* info; uint32_t drm_format; Uint32 RGBAmasks[4]; - DriSurfaceBuffer* scanout_buff = NULL; + DrmSurfaceBuffer* scanout_buff = NULL; drm_format = get_drm_format_from_etc(&bpp); if (drm_format == 0) { @@ -1534,11 +1534,11 @@ error: return NULL; } -static int DRI_AllocHWSurface_Accl(_THIS, GAL_Surface *surface) +static int DRM_AllocHWSurface_Accl(_THIS, GAL_Surface *surface) { - DriVideoData* vdata = this->hidden; + DrmVideoData* vdata = this->hidden; uint32_t drm_format; - DriSurfaceBuffer* surface_buffer; + DrmSurfaceBuffer* surface_buffer; drm_format = translate_gal_format(surface->format); if (drm_format == 0) { @@ -1574,12 +1574,12 @@ error: return -1; } -static void DRI_FreeHWSurface_Accl(_THIS, GAL_Surface *surface) +static void DRM_FreeHWSurface_Accl(_THIS, GAL_Surface *surface) { - DriVideoData* vdata = this->hidden; - DriSurfaceBuffer* surface_buffer; + DrmVideoData* vdata = this->hidden; + DrmSurfaceBuffer* surface_buffer; - surface_buffer = (DriSurfaceBuffer*)surface->hwdata; + surface_buffer = (DrmSurfaceBuffer*)surface->hwdata; if (surface_buffer) { if (surface_buffer->pixels) vdata->driver_ops->unmap_buffer(vdata->driver, surface_buffer); @@ -1590,15 +1590,15 @@ static void DRI_FreeHWSurface_Accl(_THIS, GAL_Surface *surface) surface->hwdata = NULL; } -static int DRI_HWBlit(GAL_Surface *src, GAL_Rect *src_rc, +static int DRM_HWBlit(GAL_Surface *src, GAL_Rect *src_rc, GAL_Surface *dst, GAL_Rect *dst_rc) { GAL_VideoDevice *this = __mg_current_video; - DriVideoData* vdata = this->hidden; - DriSurfaceBuffer *src_buf, *dst_buf; + DrmVideoData* vdata = this->hidden; + DrmSurfaceBuffer *src_buf, *dst_buf; - src_buf = (DriSurfaceBuffer*)src->hwdata; - dst_buf = (DriSurfaceBuffer*)dst->hwdata; + src_buf = (DrmSurfaceBuffer*)src->hwdata; + dst_buf = (DrmSurfaceBuffer*)dst->hwdata; if ((src->flags & GAL_SRCALPHA) == GAL_SRCALPHA && (src->flags & GAL_SRCCOLORKEY) == GAL_SRCCOLORKEY) { @@ -1624,14 +1624,14 @@ static int DRI_HWBlit(GAL_Surface *src, GAL_Rect *src_rc, return 0; } -static int DRI_CheckHWBlit_Accl(_THIS, GAL_Surface *src, GAL_Surface *dst) +static int DRM_CheckHWBlit_Accl(_THIS, GAL_Surface *src, GAL_Surface *dst) { - DriVideoData* vdata = this->hidden; - DriSurfaceBuffer *src_buf, *dst_buf; + DrmVideoData* vdata = this->hidden; + DrmSurfaceBuffer *src_buf, *dst_buf; int accelerated; - src_buf = (DriSurfaceBuffer*)src->hwdata; - dst_buf = (DriSurfaceBuffer*)dst->hwdata; + src_buf = (DrmSurfaceBuffer*)src->hwdata; + dst_buf = (DrmSurfaceBuffer*)dst->hwdata; /* Set initial acceleration on */ src->flags |= GAL_HWACCEL; @@ -1658,7 +1658,7 @@ static int DRI_CheckHWBlit_Accl(_THIS, GAL_Surface *src, GAL_Surface *dst) accelerated = !!(src->flags & GAL_HWACCEL); if (accelerated && vdata->driver_ops->check_blit(vdata->driver, src_buf, dst_buf) == 0) { - src->map->hw_blit = DRI_HWBlit; + src->map->hw_blit = DRM_HWBlit; } else { src->map->hw_blit = NULL; @@ -1669,30 +1669,30 @@ static int DRI_CheckHWBlit_Accl(_THIS, GAL_Surface *src, GAL_Surface *dst) return accelerated; } -static int DRI_FillHWRect_Accl(_THIS, GAL_Surface *dst, GAL_Rect *rect, +static int DRM_FillHWRect_Accl(_THIS, GAL_Surface *dst, GAL_Rect *rect, Uint32 color) { - DriVideoData* vdata = this->hidden; - DriSurfaceBuffer *dst_buf; + DrmVideoData* vdata = this->hidden; + DrmSurfaceBuffer *dst_buf; - dst_buf = (DriSurfaceBuffer*)dst->hwdata; + dst_buf = (DrmSurfaceBuffer*)dst->hwdata; return vdata->driver_ops->clear_buffer(vdata->driver, dst_buf, rect, color); } -static void DRI_UpdateRects_Accl (_THIS, int numrects, GAL_Rect *rects) +static void DRM_UpdateRects_Accl (_THIS, int numrects, GAL_Rect *rects) { - DriVideoData* vdata = this->hidden; + DrmVideoData* vdata = this->hidden; if (vdata->driver_ops->flush_driver) vdata->driver_ops->flush_driver(vdata->driver); } -static int DRI_SetHWColorKey_Accl(_THIS, GAL_Surface *surface, Uint32 key) +static int DRM_SetHWColorKey_Accl(_THIS, GAL_Surface *surface, Uint32 key) { return 0; } -static int DRI_SetHWAlpha_Accl(_THIS, GAL_Surface *surface, Uint8 value) +static int DRM_SetHWAlpha_Accl(_THIS, GAL_Surface *surface, Uint8 value) { return 0; } @@ -1700,8 +1700,8 @@ static int DRI_SetHWAlpha_Accl(_THIS, GAL_Surface *surface, Uint8 value) MG_EXPORT int driGetDeviceFD (GHANDLE video) { GAL_VideoDevice *this = (GAL_VideoDevice *)video; - if (this && this->VideoInit == DRI_VideoInit) { - DriVideoData* vdata = this->hidden; + if (this && this->VideoInit == DRM_VideoInit) { + DrmVideoData* vdata = this->hidden; return vdata->dev_fd; } @@ -1709,13 +1709,13 @@ MG_EXPORT int driGetDeviceFD (GHANDLE video) } /* called by driGetSurfaceInfo */ -BOOL __dri_get_surface_info (GAL_Surface *surface, DriSurfaceInfo* info) +BOOL __drm_get_surface_info (GAL_Surface *surface, DrmSurfaceInfo* info) { GAL_VideoDevice *this = (GAL_VideoDevice *)surface->video; - if (this && this->VideoInit == DRI_VideoInit && + if (this && this->VideoInit == DRM_VideoInit && (surface->flags & GAL_HWSURFACE)) { - DriSurfaceBuffer* surface_buffer = (DriSurfaceBuffer*)surface->hwdata; + DrmSurfaceBuffer* surface_buffer = (DrmSurfaceBuffer*)surface->hwdata; if (surface_buffer) { info->handle = surface_buffer->handle; @@ -1733,18 +1733,18 @@ BOOL __dri_get_surface_info (GAL_Surface *surface, DriSurfaceInfo* info) } /* called by driCreateDCFromName */ -GAL_Surface* __dri_create_surface_from_name (GHANDLE video, +GAL_Surface* __drm_create_surface_from_name (GHANDLE video, uint32_t name, uint32_t drm_format, unsigned int width, unsigned int height, uint32_t pitch) { GAL_VideoDevice *this = (GAL_VideoDevice *)video; - DriVideoData* vdata = this->hidden; - DriSurfaceBuffer* surface_buffer; + DrmVideoData* vdata = this->hidden; + DrmSurfaceBuffer* surface_buffer; GAL_Surface* surface = NULL; Uint32 RGBAmasks[4]; int depth; - if (this && this->VideoInit != DRI_VideoInit) { + if (this && this->VideoInit != DRM_VideoInit) { return NULL; } @@ -1828,18 +1828,18 @@ error: } /* called by driCreateDCFromHandle */ -GAL_Surface* __dri_create_surface_from_handle (GHANDLE video, +GAL_Surface* __drm_create_surface_from_handle (GHANDLE video, uint32_t handle, unsigned long size, uint32_t drm_format, unsigned int width, unsigned int height, uint32_t pitch) { GAL_VideoDevice *this = (GAL_VideoDevice *)video; - DriVideoData* vdata = this->hidden; - DriSurfaceBuffer* surface_buffer; + DrmVideoData* vdata = this->hidden; + DrmSurfaceBuffer* surface_buffer; GAL_Surface* surface = NULL; Uint32 RGBAmasks[4]; int depth; - if (this && this->VideoInit != DRI_VideoInit) { + if (this && this->VideoInit != DRM_VideoInit) { return NULL; } @@ -1923,18 +1923,18 @@ error: } /* called by driCreateDCFromPrimeFd */ -GAL_Surface* __dri_create_surface_from_prime_fd (GHANDLE video, +GAL_Surface* __drm_create_surface_from_prime_fd (GHANDLE video, int prime_fd, unsigned long size, uint32_t drm_format, unsigned int width, unsigned int height, uint32_t pitch) { GAL_VideoDevice *this = (GAL_VideoDevice *)video; - DriVideoData* vdata = this->hidden; - DriSurfaceBuffer* surface_buffer; + DrmVideoData* vdata = this->hidden; + DrmSurfaceBuffer* surface_buffer; GAL_Surface* surface = NULL; Uint32 RGBAmasks[4]; int depth; - if (this && this->VideoInit != DRI_VideoInit) { + if (this && this->VideoInit != DRM_VideoInit) { return NULL; } @@ -2017,5 +2017,5 @@ error: return NULL; } -#endif /* _MGGAL_DRI */ +#endif /* _MGGAL_DRM */ diff --git a/src/newgal/dri/drivideo.h b/src/newgal/drm/drmvideo.h similarity index 97% rename from src/newgal/dri/drivideo.h rename to src/newgal/drm/drmvideo.h index 6c99769a..ff867876 100644 --- a/src/newgal/dri/drivideo.h +++ b/src/newgal/drm/drmvideo.h @@ -64,8 +64,8 @@ typedef struct GAL_PrivateVideoData { int dev_fd; void* exdrv_handle; - DriDriverOps* driver_ops; - DriDriver* driver; + DrmDriverOps* driver_ops; + DrmDriver* driver; DrmModeInfo* mode_list; GAL_Rect** modes; @@ -87,7 +87,7 @@ typedef struct GAL_PrivateVideoData { /* only valid when using DRM driver */ uint32_t console_buff_id; -} DriVideoData; +} DrmVideoData; #endif /* _NEWGAL_DRIVIDEO_H */ diff --git a/src/newgal/dri/makefile.ng b/src/newgal/drm/makefile.ng similarity index 100% rename from src/newgal/dri/makefile.ng rename to src/newgal/drm/makefile.ng diff --git a/src/newgal/sysvideo.h b/src/newgal/sysvideo.h index b0496320..17453233 100644 --- a/src/newgal/sysvideo.h +++ b/src/newgal/sysvideo.h @@ -328,8 +328,8 @@ extern VideoBootStrap STGFB_bootstrap; #ifdef _MGGAL_USVFB extern VideoBootStrap USVFB_bootstrap; #endif -#ifdef _MGGAL_DRI -extern VideoBootStrap DRI_bootstrap; +#ifdef _MGGAL_DRM +extern VideoBootStrap DRM_bootstrap; #endif /* This is the current video device */ diff --git a/src/newgal/video.c b/src/newgal/video.c index 78469167..676bad49 100644 --- a/src/newgal/video.c +++ b/src/newgal/video.c @@ -156,8 +156,8 @@ static VideoBootStrap *bootstrap[] = { #ifdef _MGGAL_USVFB &USVFB_bootstrap, #endif -#ifdef _MGGAL_DRI - &DRI_bootstrap, +#ifdef _MGGAL_DRM + &DRM_bootstrap, #endif NULL }; diff --git a/src/newgdi/gdi.c b/src/newgdi/gdi.c index 8e2ea17f..e51d6ea0 100644 --- a/src/newgdi/gdi.c +++ b/src/newgdi/gdi.c @@ -3749,26 +3749,26 @@ MG_EXPORT GHANDLE GetVideoHandle (HDC hdc) return (GHANDLE)pdc->surface->video; } -#ifdef _MGGAL_DRI +#ifdef _MGGAL_DRM /* implemented in DRI engine. */ -BOOL __dri_get_surface_info (GAL_Surface *surface, DriSurfaceInfo* info); +BOOL __drm_get_surface_info (GAL_Surface *surface, DrmSurfaceInfo* info); -MG_EXPORT BOOL driGetSurfaceInfo (GHANDLE video, HDC hdc, DriSurfaceInfo* info) +MG_EXPORT BOOL drmGetSurfaceInfo (GHANDLE video, HDC hdc, DrmSurfaceInfo* info) { PDC pdc = dc_HDC2PDC (hdc); if (pdc->surface->video != (GHANDLE)video) return FALSE; - return __dri_get_surface_info(pdc->surface, info); + return __drm_get_surface_info(pdc->surface, info); } /* implemented in DRI engine. */ -GAL_Surface* __dri_create_surface_from_name (GHANDLE video, +GAL_Surface* __drm_create_surface_from_name (GHANDLE video, uint32_t name, uint32_t drm_format, unsigned int width, unsigned int height, uint32_t pitch); -MG_EXPORT HDC driCreateDCFromName (GHANDLE video, +MG_EXPORT HDC drmCreateDCFromName (GHANDLE video, uint32_t name, uint32_t drm_format, unsigned int width, unsigned int height, uint32_t pitch) { @@ -3779,7 +3779,7 @@ MG_EXPORT HDC driCreateDCFromName (GHANDLE video, return HDC_INVALID; LOCK (&__mg_gdilock); - surface = __dri_create_surface_from_name (video, name, + surface = __drm_create_surface_from_name (video, name, drm_format, width, height, pitch); UNLOCK (&__mg_gdilock); @@ -3817,11 +3817,11 @@ MG_EXPORT HDC driCreateDCFromName (GHANDLE video, } /* implemented in DRI engine. */ -GAL_Surface* __dri_create_surface_from_handle (GHANDLE video, +GAL_Surface* __drm_create_surface_from_handle (GHANDLE video, uint32_t handle, unsigned long size, uint32_t drm_format, unsigned int width, unsigned int height, uint32_t pitch); -MG_EXPORT HDC driCreateDCFromHandle (GHANDLE video, +MG_EXPORT HDC drmCreateDCFromHandle (GHANDLE video, uint32_t handle, unsigned long size, uint32_t drm_format, unsigned int width, unsigned int height, uint32_t pitch) { @@ -3832,7 +3832,7 @@ MG_EXPORT HDC driCreateDCFromHandle (GHANDLE video, return HDC_INVALID; LOCK (&__mg_gdilock); - surface = __dri_create_surface_from_handle (video, handle, size, + surface = __drm_create_surface_from_handle (video, handle, size, drm_format, width, height, pitch); UNLOCK (&__mg_gdilock); @@ -3870,11 +3870,11 @@ MG_EXPORT HDC driCreateDCFromHandle (GHANDLE video, } /* implemented in DRI engine. */ -GAL_Surface* __dri_create_surface_from_prime_fd (GHANDLE video, +GAL_Surface* __drm_create_surface_from_prime_fd (GHANDLE video, int prime_fd, unsigned long size, uint32_t drm_format, unsigned int width, unsigned int height, uint32_t pitch); -MG_EXPORT HDC driCreateDCFromPrimeFd (GHANDLE video, +MG_EXPORT HDC drmCreateDCFromPrimeFd (GHANDLE video, int prime_fd, unsigned long size, uint32_t drm_format, unsigned int width, unsigned int height, uint32_t pitch) { @@ -3885,7 +3885,7 @@ MG_EXPORT HDC driCreateDCFromPrimeFd (GHANDLE video, return HDC_INVALID; LOCK (&__mg_gdilock); - surface =__dri_create_surface_from_prime_fd (video, prime_fd, size, + surface =__drm_create_surface_from_prime_fd (video, prime_fd, size, drm_format, width, height, pitch); UNLOCK (&__mg_gdilock);