[PATCH] xf86i2c: add pscrn for drivers to use
Alex Deucher
alexdeucher at gmail.com
Thu May 24 07:39:59 PDT 2012
On Thu, May 24, 2012 at 2:28 AM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> This just adds a pScrn pointer into the struct for the drivers to use
> instead of scrnIndex. Mostly scrnIndex is used for logging, but some
> drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
>
> Removing the scrnIndex is a bit more involved and I'm not sure its worth
> the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
Maybe someday we can rip out all this old crap and finally drop
support for 15 year old hw.
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
> ---
> hw/xfree86/i2c/xf86i2c.c | 1 +
> hw/xfree86/i2c/xf86i2c.h | 2 ++
> 2 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/hw/xfree86/i2c/xf86i2c.c b/hw/xfree86/i2c/xf86i2c.c
> index 1273f4b..2d261d4 100644
> --- a/hw/xfree86/i2c/xf86i2c.c
> +++ b/hw/xfree86/i2c/xf86i2c.c
> @@ -709,6 +709,7 @@ xf86CreateI2CBusRec(void)
>
> if (b != NULL) {
> b->scrnIndex = -1;
> + b->pScrn = NULL;
> b->HoldTime = 5; /* 100 kHz bus */
> b->BitTimeout = 5;
> b->ByteTimeout = 5;
> diff --git a/hw/xfree86/i2c/xf86i2c.h b/hw/xfree86/i2c/xf86i2c.h
> index 9a8fb21..e296d7d 100644
> --- a/hw/xfree86/i2c/xf86i2c.h
> +++ b/hw/xfree86/i2c/xf86i2c.h
> @@ -6,6 +6,7 @@
> #define _XF86I2C_H
>
> #include "regionstr.h"
> +#include "xf86.h"
>
> typedef unsigned char I2CByte;
> typedef unsigned short I2CSlaveAddr;
> @@ -18,6 +19,7 @@ typedef struct _I2CDevRec *I2CDevPtr;
> typedef struct _I2CBusRec {
> char *BusName;
> int scrnIndex;
> + ScrnInfoPtr pScrn;
>
> void (*I2CUDelay) (I2CBusPtr b, int usec);
>
> --
> 1.7.6
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
More information about the xorg-devel
mailing list