[PATCH xf86-video-r128] xf86-video-r128: remove the GlxSetVisualConfigs stub and friends
Connor Behan
connor.behan at gmail.com
Fri Aug 4 17:00:00 UTC 2017
On 31/07/17 09:13 AM, Emil Velikov wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
>
> The function was an empty since 2008 at least. Remove it alongside the
> unused GLX visuals code.
>
> With this all the GL/GLX dependencies in the driver are gone.
>
> Cc: Adam Jackson <ajax at redhat.com>
> Cc: Connor Behan <connor.behan at gmail.com>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
Tested-by: Connor Behan <connor.behan at gmail.com>
> ---
> src/r128.h | 4 -
> src/r128_dri.c | 221 +----------------------------------------------------
> src/r128_dripriv.h | 10 ---
> src/r128_driver.c | 4 +-
> 4 files changed, 3 insertions(+), 236 deletions(-)
>
> diff --git a/src/r128.h b/src/r128.h
> index e3253a5..ae3e379 100644
> --- a/src/r128.h
> +++ b/src/r128.h
> @@ -70,7 +70,6 @@
> #define _XF86DRI_SERVER_
> #include "r128_dripriv.h"
> #include "dri.h"
> -#include "GL/glxint.h"
> #endif
>
> #include "fb.h"
> @@ -382,9 +381,6 @@ typedef struct {
> DRIInfoPtr pDRIInfo;
> int drmFD;
> drm_context_t drmCtx;
> - int numVisualConfigs;
> - __GLXvisualConfig *pVisualConfigs;
> - R128ConfigPrivPtr pVisualConfigsPriv;
>
> drm_handle_t fbHandle;
>
> diff --git a/src/r128_dri.c b/src/r128_dri.c
> index 467cd88..ed18fab 100644
> --- a/src/r128_dri.c
> +++ b/src/r128_dri.c
> @@ -56,9 +56,8 @@
> #include "windowstr.h"
>
> #include "shadowfb.h"
> - /* GLX/DRI/DRM definitions */
> + /* DRI/DRM definitions */
> #define _XF86DRI_SERVER_
> -#include "GL/glxtokens.h"
> #include "sarea.h"
>
> static size_t r128_drm_page_size;
> @@ -70,209 +69,6 @@ static void R128DRITransitionSingleToMulti3d(ScreenPtr pScreen);
>
> static void R128DRIRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox);
>
> -/* Initialize the visual configs that are supported by the hardware.
> - These are combined with the visual configs that the indirect
> - rendering core supports, and the intersection is exported to the
> - client. */
> -static Bool R128InitVisualConfigs(ScreenPtr pScreen)
> -{
> - ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
> - R128InfoPtr info = R128PTR(pScrn);
> - int numConfigs = 0;
> - __GLXvisualConfig *pConfigs = NULL;
> - R128ConfigPrivPtr pR128Configs = NULL;
> - R128ConfigPrivPtr *pR128ConfigPtrs = NULL;
> - int i, accum, stencil, db;
> -
> - switch (info->CurrentLayout.pixel_code) {
> - case 8: /* 8bpp mode is not support */
> - case 15: /* FIXME */
> - case 24: /* FIXME */
> - xf86DrvMsg(pScreen->myNum, X_ERROR,
> - "[dri] R128DRIScreenInit failed (depth %d not supported). "
> - "Disabling DRI.\n", info->CurrentLayout.pixel_code);
> - return FALSE;
> -
> -#define R128_USE_ACCUM 1
> -#define R128_USE_STENCIL 1
> -#define R128_USE_DB 1
> -
> - case 16:
> - numConfigs = 1;
> - if (R128_USE_ACCUM) numConfigs *= 2;
> - if (R128_USE_STENCIL) numConfigs *= 2;
> - if (R128_USE_DB) numConfigs *= 2;
> -
> - if (!(pConfigs
> - = (__GLXvisualConfig*)calloc(sizeof(__GLXvisualConfig),
> - numConfigs))) {
> - return FALSE;
> - }
> - if (!(pR128Configs
> - = (R128ConfigPrivPtr)calloc(sizeof(R128ConfigPrivRec),
> - numConfigs))) {
> - free(pConfigs);
> - return FALSE;
> - }
> - if (!(pR128ConfigPtrs
> - = (R128ConfigPrivPtr*)calloc(sizeof(R128ConfigPrivPtr),
> - numConfigs))) {
> - free(pConfigs);
> - free(pR128Configs);
> - return FALSE;
> - }
> -
> - i = 0;
> - for (db = 0; db <= R128_USE_DB; db++) {
> - for (accum = 0; accum <= R128_USE_ACCUM; accum++) {
> - for (stencil = 0; stencil <= R128_USE_STENCIL; stencil++) {
> - pR128ConfigPtrs[i] = &pR128Configs[i];
> -
> - pConfigs[i].vid = (VisualID)(-1);
> - pConfigs[i].class = -1;
> - pConfigs[i].rgba = TRUE;
> - pConfigs[i].redSize = 5;
> - pConfigs[i].greenSize = 6;
> - pConfigs[i].blueSize = 5;
> - pConfigs[i].alphaSize = 0;
> - pConfigs[i].redMask = 0x0000F800;
> - pConfigs[i].greenMask = 0x000007E0;
> - pConfigs[i].blueMask = 0x0000001F;
> - pConfigs[i].alphaMask = 0x00000000;
> - if (accum) { /* Simulated in software */
> - pConfigs[i].accumRedSize = 16;
> - pConfigs[i].accumGreenSize = 16;
> - pConfigs[i].accumBlueSize = 16;
> - pConfigs[i].accumAlphaSize = 0;
> - } else {
> - pConfigs[i].accumRedSize = 0;
> - pConfigs[i].accumGreenSize = 0;
> - pConfigs[i].accumBlueSize = 0;
> - pConfigs[i].accumAlphaSize = 0;
> - }
> - if (db)
> - pConfigs[i].doubleBuffer = TRUE;
> - else
> - pConfigs[i].doubleBuffer = FALSE;
> - pConfigs[i].stereo = FALSE;
> - pConfigs[i].bufferSize = 16;
> - pConfigs[i].depthSize = 16;
> - if (stencil)
> - pConfigs[i].stencilSize = 8; /* Simulated in software */
> - else
> - pConfigs[i].stencilSize = 0;
> - pConfigs[i].auxBuffers = 0;
> - pConfigs[i].level = 0;
> - if (accum || stencil) {
> - pConfigs[i].visualRating = GLX_SLOW_CONFIG;
> - } else {
> - pConfigs[i].visualRating = GLX_NONE;
> - }
> - pConfigs[i].transparentPixel = GLX_NONE;
> - pConfigs[i].transparentRed = 0;
> - pConfigs[i].transparentGreen = 0;
> - pConfigs[i].transparentBlue = 0;
> - pConfigs[i].transparentAlpha = 0;
> - pConfigs[i].transparentIndex = 0;
> - i++;
> - }
> - }
> - }
> - break;
> -
> - case 32:
> - numConfigs = 1;
> - if (R128_USE_ACCUM) numConfigs *= 2;
> - if (R128_USE_STENCIL) numConfigs *= 2;
> - if (R128_USE_DB) numConfigs *= 2;
> -
> - if (!(pConfigs
> - = (__GLXvisualConfig*)calloc(sizeof(__GLXvisualConfig),
> - numConfigs))) {
> - return FALSE;
> - }
> - if (!(pR128Configs
> - = (R128ConfigPrivPtr)calloc(sizeof(R128ConfigPrivRec),
> - numConfigs))) {
> - free(pConfigs);
> - return FALSE;
> - }
> - if (!(pR128ConfigPtrs
> - = (R128ConfigPrivPtr*)calloc(sizeof(R128ConfigPrivPtr),
> - numConfigs))) {
> - free(pConfigs);
> - free(pR128Configs);
> - return FALSE;
> - }
> -
> - i = 0;
> - for (db = 0; db <= R128_USE_DB; db++) {
> - for (accum = 0; accum <= R128_USE_ACCUM; accum++) {
> - for (stencil = 0; stencil <= R128_USE_STENCIL; stencil++) {
> - pR128ConfigPtrs[i] = &pR128Configs[i];
> -
> - pConfigs[i].vid = (VisualID)(-1);
> - pConfigs[i].class = -1;
> - pConfigs[i].rgba = TRUE;
> - pConfigs[i].redSize = 8;
> - pConfigs[i].greenSize = 8;
> - pConfigs[i].blueSize = 8;
> - pConfigs[i].alphaSize = 0;
> - pConfigs[i].redMask = 0x00FF0000;
> - pConfigs[i].greenMask = 0x0000FF00;
> - pConfigs[i].blueMask = 0x000000FF;
> - pConfigs[i].alphaMask = 0x00000000;
> - if (accum) { /* Simulated in software */
> - pConfigs[i].accumRedSize = 16;
> - pConfigs[i].accumGreenSize = 16;
> - pConfigs[i].accumBlueSize = 16;
> - pConfigs[i].accumAlphaSize = 0;
> - } else {
> - pConfigs[i].accumRedSize = 0;
> - pConfigs[i].accumGreenSize = 0;
> - pConfigs[i].accumBlueSize = 0;
> - pConfigs[i].accumAlphaSize = 0;
> - }
> - if (db)
> - pConfigs[i].doubleBuffer = TRUE;
> - else
> - pConfigs[i].doubleBuffer = FALSE;
> - pConfigs[i].stereo = FALSE;
> - pConfigs[i].bufferSize = 24;
> - if (stencil) {
> - pConfigs[i].depthSize = 24;
> - pConfigs[i].stencilSize = 8;
> - } else {
> - pConfigs[i].depthSize = 24;
> - pConfigs[i].stencilSize = 0;
> - }
> - pConfigs[i].auxBuffers = 0;
> - pConfigs[i].level = 0;
> - if (accum) {
> - pConfigs[i].visualRating = GLX_SLOW_CONFIG;
> - } else {
> - pConfigs[i].visualRating = GLX_NONE;
> - }
> - pConfigs[i].transparentPixel = GLX_NONE;
> - pConfigs[i].transparentRed = 0;
> - pConfigs[i].transparentGreen = 0;
> - pConfigs[i].transparentBlue = 0;
> - pConfigs[i].transparentAlpha = 0;
> - pConfigs[i].transparentIndex = 0;
> - i++;
> - }
> - }
> - }
> - break;
> - }
> -
> - info->numVisualConfigs = numConfigs;
> - info->pVisualConfigs = pConfigs;
> - info->pVisualConfigsPriv = pR128Configs;
> - GlxSetVisualConfigs(numConfigs, pConfigs, (void**)pR128ConfigPtrs);
> - return TRUE;
> -}
> -
> /* Create the Rage 128-specific context information */
> static Bool R128CreateContext(ScreenPtr pScreen, VisualPtr visual,
> drm_context_t hwContext, void *pVisualConfigPriv,
> @@ -988,9 +784,8 @@ Bool R128DRIScreenInit(ScreenPtr pScreen)
> int major, minor, patch;
> drmVersionPtr version;
>
> - /* Check that the GLX, DRI, and DRM modules have been loaded by testing
> + /* Check that the DRI, and DRM modules have been loaded by testing
> * for known symbols in each module. */
> - if (!xf86LoaderCheckSymbol("GlxSetVisualConfigs")) return FALSE;
> if (!xf86LoaderCheckSymbol("drmAvailable")) return FALSE;
> if (!xf86LoaderCheckSymbol("DRIQueryVersion")) {
> xf86DrvMsg(pScreen->myNum, X_ERROR,
> @@ -1204,10 +999,6 @@ Bool R128DRIScreenInit(ScreenPtr pScreen)
>
> /* FIXME: When are these mappings unmapped? */
>
> - if (!R128InitVisualConfigs(pScreen)) {
> - R128DRICloseScreen(pScreen);
> - return FALSE;
> - }
> xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] Visual configs initialized\n");
>
> return TRUE;
> @@ -1370,14 +1161,6 @@ void R128DRICloseScreen(ScreenPtr pScreen)
> DRIDestroyInfoRec(info->pDRIInfo);
> info->pDRIInfo = NULL;
> }
> - if (info->pVisualConfigs) {
> - free(info->pVisualConfigs);
> - info->pVisualConfigs = NULL;
> - }
> - if (info->pVisualConfigsPriv) {
> - free(info->pVisualConfigsPriv);
> - info->pVisualConfigsPriv = NULL;
> - }
> }
>
> /* Use callbacks from dri.c to support pageflipping mode for a single
> diff --git a/src/r128_dripriv.h b/src/r128_dripriv.h
> index 269bac9..f948adf 100644
> --- a/src/r128_dripriv.h
> +++ b/src/r128_dripriv.h
> @@ -37,18 +37,8 @@
> #ifndef _R128_DRIPRIV_H_
> #define _R128_DRIPRIV_H_
>
> -#include "GL/glxint.h"
> -
> #define R128_MAX_DRAWABLES 256
>
> -extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
> - void **configprivs);
> -
> -typedef struct {
> - /* Nothing here yet */
> - int dummy;
> -} R128ConfigPrivRec, *R128ConfigPrivPtr;
> -
> typedef struct {
> /* Nothing here yet */
> int dummy;
> diff --git a/src/r128_driver.c b/src/r128_driver.c
> index 5695614..1ad111a 100644
> --- a/src/r128_driver.c
> +++ b/src/r128_driver.c
> @@ -1672,9 +1672,7 @@ Bool R128ScreenInit(SCREEN_INIT_ARGS_DECL)
> #ifdef R128DRI
> /* Setup DRI after visuals have been
> established, but before fbScreenInit is
> - called. fbScreenInit will eventually
> - call the driver's InitGLXVisuals call
> - back. */
> + called. */
> {
> /* FIXME: When we move to dynamic allocation of back and depth
> buffers, we will want to revisit the following check for 3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.x.org/archives/xorg-devel/attachments/20170804/e8613ffa/attachment.sig>
More information about the xorg-devel
mailing list