summaryrefslogtreecommitdiff
path: root/src/nv_dac.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-06-07 15:52:16 +0100
committerDave Airlie <airlied@redhat.com>2012-06-07 15:52:16 +0100
commit713e9501b87465cf2a62c27605b6fc4a454dad95 (patch)
tree0be6ee6ba5f01ad4f16c4c798a69992b36047186 /src/nv_dac.c
parentb3d61828837661c9b383378a7d6006752659108b (diff)
nv: port to new compat API.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/nv_dac.c')
-rw-r--r--src/nv_dac.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nv_dac.c b/src/nv_dac.c
index b6df107..2269ae3 100644
--- a/src/nv_dac.c
+++ b/src/nv_dac.c
@@ -373,7 +373,11 @@ NVDACLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors,
static void
NV_I2CGetBits(I2CBusPtr b, int *clock, int *data)
{
+#ifdef XF86_SCRN_INTERFACE
+ NVPtr pNv = NVPTR(b->pScrn);
+#else
NVPtr pNv = NVPTR(xf86Screens[b->scrnIndex]);
+#endif
unsigned char val;
/* Get the result. */
@@ -387,7 +391,11 @@ NV_I2CGetBits(I2CBusPtr b, int *clock, int *data)
static void
NV_I2CPutBits(I2CBusPtr b, int clock, int data)
{
+#ifdef XF86_SCRN_INTERFACE
+ NVPtr pNv = NVPTR(b->pScrn);
+#else
NVPtr pNv = NVPTR(xf86Screens[b->scrnIndex]);
+#endif
unsigned char val;
VGA_WR08(pNv->PCIO, 0x3d4, pNv->DDCBase + 1);
@@ -419,6 +427,9 @@ NVDACi2cInit(ScrnInfoPtr pScrn)
I2CPtr->BusName = "DDC";
I2CPtr->scrnIndex = pScrn->scrnIndex;
+#ifdef XF86_SCRN_INTERFACE
+ I2CPtr->pScrn = pScrn;
+#endif
I2CPtr->I2CPutBits = NV_I2CPutBits;
I2CPtr->I2CGetBits = NV_I2CGetBits;
I2CPtr->AcknTimeout = 5;