public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Support SNA via a configuration option
@ 2011-10-31 17:10 Eugeni Dodonov
  2011-10-31 17:10 ` [PATCH 1/2] Enable SNA via a configuration file option Eugeni Dodonov
  2011-10-31 17:10 ` [PATCH 2/2] Unify options handling between UXA and SNA Eugeni Dodonov
  0 siblings, 2 replies; 3+ messages in thread
From: Eugeni Dodonov @ 2011-10-31 17:10 UTC (permalink / raw)
  To: intel-gfx; +Cc: Eugeni Dodonov

This patchset adds support for enabling SNA support via a configuration
file option.

This way, it is possible to switch between UXA and SNA via config file changes,
instead of having to recompile and install full driver.

Second patch goes a bit onwards and also unifies the options between SNA and
UXA drivers into a single intelOptions structure. To reduce the universe
entropy, those options are moved into intel_opts.h header, and the modules
which need to use them do so by including this file.

Eugeni Dodonov (2):
  Enable SNA via a configuration file option.
  Unify options handling between UXA and SNA

 src/common.h                |    2 +-
 src/intel_driver.c          |  151 +++++++++++++++++++++++++++----------------
 src/intel_module.c          |   14 +---
 src/intel_opts.h            |   67 +++++++++++++++++++
 src/sna/sna.h               |   15 ----
 src/sna/sna_display.c       |    2 +
 src/sna/sna_driver.c        |   39 ++----------
 src/sna/sna_module.h        |    3 +-
 src/sna/sna_video.c         |    2 +
 src/sna/sna_video_overlay.c |    2 +
 10 files changed, 181 insertions(+), 116 deletions(-)
 create mode 100644 src/intel_opts.h

-- 
1.7.7.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] Enable SNA via a configuration file option.
  2011-10-31 17:10 [PATCH 0/2] Support SNA via a configuration option Eugeni Dodonov
@ 2011-10-31 17:10 ` Eugeni Dodonov
  2011-10-31 17:10 ` [PATCH 2/2] Unify options handling between UXA and SNA Eugeni Dodonov
  1 sibling, 0 replies; 3+ messages in thread
From: Eugeni Dodonov @ 2011-10-31 17:10 UTC (permalink / raw)
  To: intel-gfx; +Cc: Eugeni Dodonov

This allows to use UXA and SNA from within the same driver, by setting
an "UseSNA" option in the driver config - for example, by creating an
/etc/X11/xorg.conf.d/99-intel-sna.conf:

Section "Device"
	Identifier "intel"
	driver "intel"
	Option "UseSna" "True"
EndSection

This also allows to record the entity_num within the main intel driver,
not only SNA.

Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
---
 src/common.h         |    2 +-
 src/intel_driver.c   |   96 ++++++++++++++++++++++++++++++++++++++++++++++++-
 src/intel_module.c   |    6 +---
 src/sna/sna_driver.c |   14 +------
 src/sna/sna_module.h |    3 +-
 5 files changed, 100 insertions(+), 21 deletions(-)

diff --git a/src/common.h b/src/common.h
index 6f23cdd..6b86801 100644
--- a/src/common.h
+++ b/src/common.h
@@ -77,7 +77,7 @@ I830DPRINTF_stub(const char *filename, int line, const char *function,
 
 /* I830 hooks for the I810 driver setup/probe. */
 extern const OptionInfoRec *I830AvailableOptions(int chipid, int busid);
-extern void intel_init_scrn(ScrnInfoPtr scrn);
+extern void intel_init_scrn(ScrnInfoPtr scrn, int entity_num);
 
 /* Symbol lists shared by the i810 and i830 parts. */
 extern int I830EntityIndex;
diff --git a/src/intel_driver.c b/src/intel_driver.c
index 24696da..09c306c 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -101,6 +101,7 @@ typedef enum {
    OPTION_DEBUG_WAIT,
    OPTION_HOTPLUG,
    OPTION_RELAXED_FENCING,
+   OPTION_USE_SNA,
 } I830Opts;
 
 static OptionInfoRec I830Options[] = {
@@ -122,6 +123,7 @@ static OptionInfoRec I830Options[] = {
    {OPTION_DEBUG_WAIT, "DebugWait", OPTV_BOOLEAN, {0}, FALSE},
    {OPTION_HOTPLUG,	"HotPlug",	OPTV_BOOLEAN,	{0},	TRUE},
    {OPTION_RELAXED_FENCING,	"RelaxedFencing",	OPTV_BOOLEAN,	{0},	TRUE},
+   {OPTION_USE_SNA,	"UseSna",	OPTV_BOOLEAN,	{0},	FALSE},
    {-1,			NULL,		OPTV_NONE,	{0},	FALSE}
 };
 /* *INDENT-ON* */
@@ -1326,9 +1328,91 @@ static Bool I830PMEvent(int scrnIndex, pmEvent event, Bool undo)
 	return TRUE;
 }
 
-void intel_init_scrn(ScrnInfoPtr scrn)
+/*
+ * Due to the nature of xserver drivers, we need to do a lot of
+ * things just to attempt to parse driver options. So we do it all
+ * here, check if we are supposed to use SNA, and call the corresponding
+ * real setup afterwards.
+ */
+static Bool intelPreInit(ScrnInfoPtr scrn, int flags)
 {
-	scrn->PreInit = I830PreInit;
+	rgb defaultWeight = { 0, 0, 0 };
+	Bool use_sna;
+	EntityInfoPtr pEnt;
+	int flags24;
+	OptionInfoPtr Options;
+
+	xf86DrvMsg(0, X_INFO, "Inside intelPreInit...\n");
+
+	if (scrn->numEntities != 1)
+		return FALSE;
+
+	pEnt = xf86GetEntityInfo(scrn->entityList[0]);
+
+	xf86DrvMsg(0, X_INFO, "Detecting monitor...\n");
+
+	scrn->monitor = scrn->confScreen->monitor;
+	scrn->progClock = TRUE;
+	scrn->rgbBits = 8;
+
+	flags24 = Support32bppFb | PreferConvert24to32 | SupportConvert24to32;
+
+	if (!xf86SetDepthBpp(scrn, 0, 0, 0, flags24))
+		return FALSE;
+
+	switch (scrn->depth) {
+	case 8:
+	case 15:
+	case 16:
+	case 24:
+	case 30:
+		break;
+	default:
+		xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+			   "Given depth (%d) is not supported by intel driver\n",
+			   scrn->depth);
+		return FALSE;
+	}
+
+	if (!xf86SetWeight(scrn, defaultWeight, defaultWeight))
+		return FALSE;
+	if (!xf86SetDefaultVisual(scrn, -1))
+		return FALSE;
+
+	/* Now the main trick - collecting driver option to find out if we
+	 * need SNA... */
+	xf86CollectOptions(scrn, NULL);
+
+	if (!(Options = malloc(sizeof(I830Options))))
+		return FALSE;
+	memcpy(Options, I830Options, sizeof(I830Options));
+	xf86ProcessOptions(scrn->scrnIndex, scrn->options, Options);
+
+	xf86DrvMsg(0, X_INFO, "Detecting SNA...\n");
+	use_sna = xf86ReturnOptValBool(Options,
+			OPTION_USE_SNA,
+			FALSE);
+
+	/* Clean up */
+	free(Options);
+	PreInitCleanup(scrn);
+	if (use_sna) {
+		/* Using SNA, re-initialize function pointers */
+		xf86DrvMsg(scrn->scrnIndex, X_INFO, "Enabling SNA via option\n");
+		sna_init_scrn(scrn);
+		return sna_pre_init(scrn, flags);
+	}
+	else {
+		xf86DrvMsg(scrn->scrnIndex, X_INFO, "SNA not enabled, using UXA\n");
+		return I830PreInit(scrn, flags);
+	}
+}
+
+void intel_init_scrn(ScrnInfoPtr scrn, int entity_num)
+{
+	EntityInfoPtr entity;
+
+	scrn->PreInit = intelPreInit;
 	scrn->ScreenInit = I830ScreenInit;
 	scrn->SwitchMode = I830SwitchMode;
 	scrn->AdjustFrame = i830AdjustFrame;
@@ -1337,4 +1421,12 @@ void intel_init_scrn(ScrnInfoPtr scrn)
 	scrn->FreeScreen = I830FreeScreen;
 	scrn->ValidMode = I830ValidMode;
 	scrn->PMEvent = I830PMEvent;
+
+	xf86SetEntitySharable(scrn->entityList[0]);
+
+	entity = xf86GetEntityInfo(entity_num);
+	xf86SetEntityInstanceForScreen(scrn,
+				       entity->index,
+				       xf86GetNumEntityInstances(entity->index)-1);
+	free(entity);
 }
diff --git a/src/intel_module.c b/src/intel_module.c
index cd9c1a3..a39ce21 100644
--- a/src/intel_module.c
+++ b/src/intel_module.c
@@ -344,11 +344,7 @@ static Bool intel_pci_probe(DriverPtr		driver,
 #endif
 
 		default:
-#if USE_SNA
-			sna_init_scrn(scrn, entity_num);
-#else
-			intel_init_scrn(scrn);
-#endif
+			intel_init_scrn(scrn, entity_num);
 			break;
 		}
 	}
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index 0df7ca0..4118cdd 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -396,7 +396,7 @@ static void sna_selftest(void)
  * As a result, we want to set up that server initialization once rather
  * that doing it per generation.
  */
-static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
+Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
 {
 	struct sna *sna;
 	rgb defaultWeight = { 0, 0, 0 };
@@ -1019,10 +1019,8 @@ static Bool sna_pm_event(int scrnIndex, pmEvent event, Bool undo)
 	return TRUE;
 }
 
-void sna_init_scrn(ScrnInfoPtr scrn, int entity_num)
+void sna_init_scrn(ScrnInfoPtr scrn)
 {
-	EntityInfoPtr entity;
-
 #if defined(USE_GIT_DESCRIBE)
 	xf86DrvMsg(scrn->scrnIndex, X_INFO,
 		   "SNA compiled from %s\n", git_version);
@@ -1044,12 +1042,4 @@ void sna_init_scrn(ScrnInfoPtr scrn, int entity_num)
 	scrn->FreeScreen = sna_free_screen;
 	scrn->ValidMode = sna_valid_mode;
 	scrn->PMEvent = sna_pm_event;
-
-	xf86SetEntitySharable(scrn->entityList[0]);
-
-	entity = xf86GetEntityInfo(entity_num);
-	xf86SetEntityInstanceForScreen(scrn,
-				       entity->index,
-				       xf86GetNumEntityInstances(entity->index)-1);
-	free(entity);
 }
diff --git a/src/sna/sna_module.h b/src/sna/sna_module.h
index 97d5dd5..34022ba 100644
--- a/src/sna/sna_module.h
+++ b/src/sna/sna_module.h
@@ -1,3 +1,4 @@
 const OptionInfoRec *sna_available_options(int chipid, int busid);
-void sna_init_scrn(ScrnInfoPtr scrn, int entity_num);
+void sna_init_scrn(ScrnInfoPtr scrn);
+Bool sna_pre_init(ScrnInfoPtr scrn, int flags);
 
-- 
1.7.7.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] Unify options handling between UXA and SNA
  2011-10-31 17:10 [PATCH 0/2] Support SNA via a configuration option Eugeni Dodonov
  2011-10-31 17:10 ` [PATCH 1/2] Enable SNA via a configuration file option Eugeni Dodonov
@ 2011-10-31 17:10 ` Eugeni Dodonov
  1 sibling, 0 replies; 3+ messages in thread
From: Eugeni Dodonov @ 2011-10-31 17:10 UTC (permalink / raw)
  To: intel-gfx; +Cc: Eugeni Dodonov

Unifies available options for both UXA and SNA drivers, and
moves them into a common header file, intel_opts.h.

Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
---
 src/intel_driver.c          |   63 ++++------------------------------------
 src/intel_module.c          |    8 ++---
 src/intel_opts.h            |   67 +++++++++++++++++++++++++++++++++++++++++++
 src/sna/sna.h               |   15 ---------
 src/sna/sna_display.c       |    2 +
 src/sna/sna_driver.c        |   25 ++--------------
 src/sna/sna_video.c         |    2 +
 src/sna/sna_video_overlay.c |    2 +
 8 files changed, 85 insertions(+), 99 deletions(-)

diff --git a/src/intel_driver.c b/src/intel_driver.c
index 09c306c..09307c4 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -75,58 +75,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "i915_drm.h"
 #include <xf86drmMode.h>
 
-/* *INDENT-OFF* */
-/*
- * Note: "ColorKey" is provided for compatibility with the i810 driver.
- * However, the correct option name is "VideoKey".  "ColorKey" usually
- * refers to the tranparency key for 8+24 overlays, not for video overlays.
- */
-
-typedef enum {
-   OPTION_DRI,
-   OPTION_VIDEO_KEY,
-   OPTION_COLOR_KEY,
-   OPTION_FALLBACKDEBUG,
-   OPTION_TILING_FB,
-   OPTION_TILING_2D,
-   OPTION_SHADOW,
-   OPTION_SWAPBUFFERS_WAIT,
-   OPTION_TRIPLE_BUFFER,
-#ifdef INTEL_XVMC
-   OPTION_XVMC,
-#endif
-   OPTION_PREFER_OVERLAY,
-   OPTION_DEBUG_FLUSH_BATCHES,
-   OPTION_DEBUG_FLUSH_CACHES,
-   OPTION_DEBUG_WAIT,
-   OPTION_HOTPLUG,
-   OPTION_RELAXED_FENCING,
-   OPTION_USE_SNA,
-} I830Opts;
-
-static OptionInfoRec I830Options[] = {
-   {OPTION_DRI,		"DRI",		OPTV_BOOLEAN,	{0},	TRUE},
-   {OPTION_COLOR_KEY,	"ColorKey",	OPTV_INTEGER,	{0},	FALSE},
-   {OPTION_VIDEO_KEY,	"VideoKey",	OPTV_INTEGER,	{0},	FALSE},
-   {OPTION_FALLBACKDEBUG, "FallbackDebug", OPTV_BOOLEAN, {0},	FALSE},
-   {OPTION_TILING_2D,	"Tiling",	OPTV_BOOLEAN,	{0},	TRUE},
-   {OPTION_TILING_FB,	"LinearFramebuffer",	OPTV_BOOLEAN,	{0},	FALSE},
-   {OPTION_SHADOW,	"Shadow",	OPTV_BOOLEAN,	{0},	FALSE},
-   {OPTION_SWAPBUFFERS_WAIT, "SwapbuffersWait", OPTV_BOOLEAN,	{0},	TRUE},
-   {OPTION_TRIPLE_BUFFER, "TripleBuffer", OPTV_BOOLEAN,	{0},	TRUE},
-#ifdef INTEL_XVMC
-   {OPTION_XVMC,	"XvMC",		OPTV_BOOLEAN,	{0},	TRUE},
-#endif
-   {OPTION_PREFER_OVERLAY, "XvPreferOverlay", OPTV_BOOLEAN, {0}, FALSE},
-   {OPTION_DEBUG_FLUSH_BATCHES, "DebugFlushBatches", OPTV_BOOLEAN, {0}, FALSE},
-   {OPTION_DEBUG_FLUSH_CACHES, "DebugFlushCaches", OPTV_BOOLEAN, {0}, FALSE},
-   {OPTION_DEBUG_WAIT, "DebugWait", OPTV_BOOLEAN, {0}, FALSE},
-   {OPTION_HOTPLUG,	"HotPlug",	OPTV_BOOLEAN,	{0},	TRUE},
-   {OPTION_RELAXED_FENCING,	"RelaxedFencing",	OPTV_BOOLEAN,	{0},	TRUE},
-   {OPTION_USE_SNA,	"UseSna",	OPTV_BOOLEAN,	{0},	FALSE},
-   {-1,			NULL,		OPTV_NONE,	{0},	FALSE}
-};
-/* *INDENT-ON* */
+#include "intel_opts.h"
 
 static void i830AdjustFrame(int scrnIndex, int x, int y, int flags);
 static Bool I830CloseScreen(int scrnIndex, ScreenPtr screen);
@@ -155,7 +104,7 @@ I830DPRINTF(const char *filename, int line, const char *function,
 /* Export I830 options to i830 driver where necessary */
 const OptionInfoRec *intel_uxa_available_options(int chipid, int busid)
 {
-	return I830Options;
+	return intelOptions;
 }
 
 static void
@@ -293,9 +242,9 @@ static Bool I830GetEarlyOptions(ScrnInfoPtr scrn)
 
 	/* Process the options */
 	xf86CollectOptions(scrn, NULL);
-	if (!(intel->Options = malloc(sizeof(I830Options))))
+	if (!(intel->Options = malloc(sizeof(intelOptions))))
 		return FALSE;
-	memcpy(intel->Options, I830Options, sizeof(I830Options));
+	memcpy(intel->Options, intelOptions, sizeof(intelOptions));
 	xf86ProcessOptions(scrn->scrnIndex, scrn->options, intel->Options);
 
 	intel->fallback_debug = xf86ReturnOptValBool(intel->Options,
@@ -1383,9 +1332,9 @@ static Bool intelPreInit(ScrnInfoPtr scrn, int flags)
 	 * need SNA... */
 	xf86CollectOptions(scrn, NULL);
 
-	if (!(Options = malloc(sizeof(I830Options))))
+	if (!(Options = malloc(sizeof(intelOptions))))
 		return FALSE;
-	memcpy(Options, I830Options, sizeof(I830Options));
+	memcpy(Options, intelOptions, sizeof(intelOptions));
 	xf86ProcessOptions(scrn->scrnIndex, scrn->options, Options);
 
 	xf86DrvMsg(0, X_INFO, "Detecting SNA...\n");
diff --git a/src/intel_module.c b/src/intel_module.c
index a39ce21..da23217 100644
--- a/src/intel_module.c
+++ b/src/intel_module.c
@@ -40,6 +40,8 @@
 
 #include <xf86drmMode.h>
 
+#include "intel_opts.h"
+
 static struct intel_device_info *chipset_info;
 
 static const struct intel_device_info intel_i81x_info = {
@@ -381,11 +383,7 @@ intel_available_options(int chipid, int busid)
 #endif
 
 	default:
-#if USE_SNA
-		return sna_available_options(chipid, busid);
-#else
-		return intel_uxa_available_options(chipid, busid);
-#endif
+		return intelOptions;
 	}
 }
 
diff --git a/src/intel_opts.h b/src/intel_opts.h
new file mode 100644
index 0000000..200e45c
--- /dev/null
+++ b/src/intel_opts.h
@@ -0,0 +1,67 @@
+/* *INDENT-OFF* */
+/*
+ * Note: "ColorKey" is provided for compatibility with the i810 driver.
+ * However, the correct option name is "VideoKey".  "ColorKey" usually
+ * refers to the tranparency key for 8+24 overlays, not for video overlays.
+ */
+
+typedef enum {
+   OPTION_DRI,
+   OPTION_VIDEO_KEY,
+   OPTION_COLOR_KEY,
+   OPTION_FALLBACKDEBUG,
+   OPTION_TILING_FB,
+   OPTION_TILING_2D,
+   OPTION_SHADOW,
+   OPTION_SWAPBUFFERS_WAIT,
+   OPTION_TRIPLE_BUFFER,
+#ifdef INTEL_XVMC
+   OPTION_XVMC,
+#endif
+   OPTION_PREFER_OVERLAY,
+   OPTION_DEBUG_FLUSH_BATCHES,
+   OPTION_DEBUG_FLUSH_CACHES,
+   OPTION_DEBUG_WAIT,
+   OPTION_HOTPLUG,
+   OPTION_RELAXED_FENCING,
+   OPTION_USE_SNA,
+#ifdef USE_SNA
+   OPTION_THROTTLE,
+   OPTION_VMAP,
+   OPTION_ZAPHOD,
+   OPTION_DELAYED_FLUSH,
+#endif
+   NUM_OPTIONS,
+} intelOpts;
+
+static OptionInfoRec intelOptions[] = {
+   {OPTION_DRI,		"DRI",		OPTV_BOOLEAN,	{0},	TRUE},
+   {OPTION_COLOR_KEY,	"ColorKey",	OPTV_INTEGER,	{0},	FALSE},
+   {OPTION_VIDEO_KEY,	"VideoKey",	OPTV_INTEGER,	{0},	FALSE},
+   {OPTION_FALLBACKDEBUG, "FallbackDebug", OPTV_BOOLEAN, {0},	FALSE},
+   {OPTION_TILING_2D,	"Tiling",	OPTV_BOOLEAN,	{0},	TRUE},
+   {OPTION_TILING_FB,	"LinearFramebuffer",	OPTV_BOOLEAN,	{0},	FALSE},
+   {OPTION_SHADOW,	"Shadow",	OPTV_BOOLEAN,	{0},	FALSE},
+   {OPTION_SWAPBUFFERS_WAIT, "SwapbuffersWait", OPTV_BOOLEAN,	{0},	TRUE},
+   {OPTION_TRIPLE_BUFFER, "TripleBuffer", OPTV_BOOLEAN,	{0},	TRUE},
+#ifdef INTEL_XVMC
+   {OPTION_XVMC,	"XvMC",		OPTV_BOOLEAN,	{0},	TRUE},
+#endif
+   {OPTION_PREFER_OVERLAY, "XvPreferOverlay", OPTV_BOOLEAN, {0}, FALSE},
+   {OPTION_DEBUG_FLUSH_BATCHES, "DebugFlushBatches", OPTV_BOOLEAN, {0}, FALSE},
+   {OPTION_DEBUG_FLUSH_CACHES, "DebugFlushCaches", OPTV_BOOLEAN, {0}, FALSE},
+   {OPTION_DEBUG_WAIT, "DebugWait", OPTV_BOOLEAN, {0}, FALSE},
+   {OPTION_HOTPLUG,	"HotPlug",	OPTV_BOOLEAN,	{0},	TRUE},
+   {OPTION_RELAXED_FENCING,	"RelaxedFencing",	OPTV_BOOLEAN,	{0},	TRUE},
+   {OPTION_USE_SNA,	"UseSna",	OPTV_BOOLEAN,	{0},	FALSE},
+#ifdef USE_SNA
+   {OPTION_THROTTLE,	"Throttle",	OPTV_BOOLEAN,	{0},	TRUE},
+   {OPTION_VMAP,	"UseVmap",	OPTV_BOOLEAN,	{0},	TRUE},
+   {OPTION_ZAPHOD,	"ZaphodHeads",	OPTV_STRING,	{0},	FALSE},
+   {OPTION_DELAYED_FLUSH,	"DelayedFlush",	OPTV_BOOLEAN,	{0},	TRUE},
+#endif
+   {-1,			NULL,		OPTV_NONE,	{0},	FALSE}
+};
+/* *INDENT-ON* */
+
+
diff --git a/src/sna/sna.h b/src/sna/sna.h
index 3d2ecaf..1d5cadc 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -182,21 +182,6 @@ static inline void sna_set_pixmap(PixmapPtr pixmap, struct sna_pixmap *sna)
 }
 
 enum {
-	OPTION_TILING_FB,
-	OPTION_TILING_2D,
-	OPTION_PREFER_OVERLAY,
-	OPTION_COLOR_KEY,
-	OPTION_VIDEO_KEY,
-	OPTION_HOTPLUG,
-	OPTION_THROTTLE,
-	OPTION_RELAXED_FENCING,
-	OPTION_VMAP,
-	OPTION_ZAPHOD,
-	OPTION_DELAYED_FLUSH,
-	NUM_OPTIONS
-};
-
-enum {
 	FLUSH_TIMER = 0,
 	EXPIRE_TIMER,
 	NUM_TIMERS
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 98743bc..b6e9351 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -43,6 +43,8 @@
 #include "sna.h"
 #include "sna_reg.h"
 
+#include "intel_opts.h"
+
 #if DEBUG_DISPLAY
 #undef DBG
 #define DBG(x) ErrorF x
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index 4118cdd..a5b049b 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -65,6 +65,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "sna_video.h"
 
 #include "intel_driver.h"
+#include "intel_opts.h"
 
 #include <sys/ioctl.h>
 #include <sys/fcntl.h>
@@ -80,31 +81,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define DBG(x) ErrorF x
 #endif
 
-static OptionInfoRec sna_options[] = {
-   {OPTION_TILING_FB,	"LinearFramebuffer",	OPTV_BOOLEAN,	{0},	FALSE},
-   {OPTION_TILING_2D,	"Tiling",	OPTV_BOOLEAN,	{0},	TRUE},
-   {OPTION_PREFER_OVERLAY, "XvPreferOverlay", OPTV_BOOLEAN, {0}, FALSE},
-   {OPTION_COLOR_KEY,	"ColorKey",	OPTV_INTEGER,	{0},	FALSE},
-   {OPTION_VIDEO_KEY,	"VideoKey",	OPTV_INTEGER,	{0},	FALSE},
-   {OPTION_HOTPLUG,	"HotPlug",	OPTV_BOOLEAN,	{0},	TRUE},
-   {OPTION_THROTTLE,	"Throttle",	OPTV_BOOLEAN,	{0},	TRUE},
-   {OPTION_RELAXED_FENCING,	"UseRelaxedFencing",	OPTV_BOOLEAN,	{0},	TRUE},
-   {OPTION_VMAP,	"UseVmap",	OPTV_BOOLEAN,	{0},	TRUE},
-   {OPTION_ZAPHOD,	"ZaphodHeads",	OPTV_STRING,	{0},	FALSE},
-   {OPTION_DELAYED_FLUSH,	"DelayedFlush",	OPTV_BOOLEAN,	{0},	TRUE},
-   {-1,			NULL,		OPTV_NONE,	{0},	FALSE}
-};
-
 static Bool sna_enter_vt(int scrnIndex, int flags);
 
 /* temporary */
 extern void xf86SetCursor(ScreenPtr screen, CursorPtr pCurs, int x, int y);
 
-const OptionInfoRec *sna_available_options(int chipid, int busid)
-{
-	return sna_options;
-}
-
 static void
 sna_load_palette(ScrnInfoPtr scrn, int numColors, int *indices,
 		 LOCO * colors, VisualPtr pVisual)
@@ -265,10 +246,10 @@ static Bool sna_get_early_options(ScrnInfoPtr scrn)
 
 	/* Process the options */
 	xf86CollectOptions(scrn, NULL);
-	if (!(sna->Options = malloc(sizeof(sna_options))))
+	if (!(sna->Options = malloc(sizeof(intelOptions))))
 		return FALSE;
 
-	memcpy(sna->Options, sna_options, sizeof(sna_options));
+	memcpy(sna->Options, intelOptions, sizeof(intelOptions));
 	xf86ProcessOptions(scrn->scrnIndex, scrn->options, sna->Options);
 
 	return TRUE;
diff --git a/src/sna/sna_video.c b/src/sna/sna_video.c
index d1d5b52..2665536 100644
--- a/src/sna/sna_video.c
+++ b/src/sna/sna_video.c
@@ -57,6 +57,8 @@
 #include "sna_reg.h"
 #include "sna_video.h"
 
+#include "intel_opts.h"
+
 #include <xf86xv.h>
 #include <X11/extensions/Xv.h>
 
diff --git a/src/sna/sna_video_overlay.c b/src/sna/sna_video_overlay.c
index a20c111..51173fb 100644
--- a/src/sna/sna_video_overlay.c
+++ b/src/sna/sna_video_overlay.c
@@ -36,6 +36,8 @@
 #include <fourcc.h>
 #include <i915_drm.h>
 
+#include "intel_opts.h"
+
 #if DEBUG_VIDEO_OVERLAY
 #undef DBG
 #define DBG(x) ErrorF x
-- 
1.7.7.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-31 17:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-31 17:10 [PATCH 0/2] Support SNA via a configuration option Eugeni Dodonov
2011-10-31 17:10 ` [PATCH 1/2] Enable SNA via a configuration file option Eugeni Dodonov
2011-10-31 17:10 ` [PATCH 2/2] Unify options handling between UXA and SNA Eugeni Dodonov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox