Commit e1c304e2 authored by Keith Packard's avatar Keith Packard
Browse files

Add refresh rates to RandR (v1.1)

parent 5804e69f
......@@ -444,7 +444,7 @@ fbdevRandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
randr = KdSubRotation (scrpriv->randr, screen->randr);
RRSetCurrentConfig (pScreen, randr, pSize);
RRSetCurrentConfig (pScreen, randr, 0, pSize);
return TRUE;
}
......@@ -474,6 +474,7 @@ fbdevLayerRemove (WindowPtr pWin, pointer value)
fbdevRandRSetConfig (ScreenPtr pScreen,
Rotation randr,
int rate,
RRScreenSizePtr pSize)
{
KdScreenPriv(pScreen);
......
......@@ -58,28 +58,5 @@ extern pcmciaDisplayModeRec pcmciaDefaultModes[];
int
ddxProcessArgument (int argc, char **argv, int i)
{
int ret;
if (!strcmp (argv[i], "-listmodes"))
{
int j = 0, bpp = 0;
ErrorF("Valid modes are....\n\n");
for (bpp = 8; bpp < 24; bpp += 8) {
while (pcmciaDefaultModes[j].Width != 0) {
if ((pcmciaDefaultModes[j].Width *
pcmciaDefaultModes[j].Height * bpp/8) <= 512 * 1024) {
ErrorF("%dx%dx%dx%d\n",
pcmciaDefaultModes[j].Width,
pcmciaDefaultModes[j].Height,
bpp,
pcmciaDefaultModes[j].Refresh);
}
j++;
}
j = 0;
}
exit(1);
}
return KdProcessArgument (argc, argv, i);
}
......@@ -123,6 +123,7 @@ mach64InitScreen (ScreenPtr pScreen)
#ifdef RANDR
mach64RandRSetConfig (ScreenPtr pScreen,
Rotation rotation,
int rate,
RRScreenSizePtr pSize)
{
KdScreenPriv(pScreen);
......
......@@ -2,9 +2,9 @@ XCOMM $XFree86$
KDRIVE=..
#include "../Kdrive.tmpl"
SRCS = pcmcia.c pcmciacurs.c pcmciastub.c pcmciashadow.c
SRCS = pcmcia.c pcmciacurs.c pcmciastub.c pcmciashadow.c pcmciarotate.c
OBJS = pcmcia.o pcmciacurs.o pcmciastub.o pcmciashadow.o
OBJS = pcmcia.o pcmciacurs.o pcmciastub.o pcmciashadow.o pcmciarotate.o
INCLUDES = -I. $(KDINCS) -I$(KDRIVE)/fbdev
......
This diff is collapsed.
......@@ -167,6 +167,7 @@ typedef struct _cop {
typedef struct _pcmciaCardInfo {
CARD8 *fb;
Bool HP;
CARD32 memory;
CARD8 *cop_base;
Cop *cop;
CARD32 *window;
......@@ -189,12 +190,11 @@ typedef struct _pcmciaCursor {
#define PCMCIA_CURSOR_HEIGHT 64
typedef struct _pcmciaScreenInfo {
int Mode;
CARD8 *cursor_base;
CARD8 *screen;
CARD8 *off_screen;
int off_screen_size;
int rotation;
int randr;
LayerPtr pLayer;
pcmciaCursor cursor;
} pcmciaScreenInfo;
......@@ -241,6 +241,10 @@ pcmciaCursorFini (ScreenPtr pScreen);
void
pcmciaRecolorCursor (ScreenPtr pScreen, int ndef, xColorItem *pdef);
void
pcmciaUpdateRotatePacked (ScreenPtr pScreen,
shadowBufPtr pBuf);
typedef struct _pcmciaDisplayModeRec {
int Width;
int Height;
......
......@@ -21,7 +21,7 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $XFree86: xc/programs/Xserver/hw/kdrive/kdrive.h,v 1.23 2002/09/29 23:39:46 keithp Exp $ */
/* $XFree86: xc/programs/Xserver/hw/kdrive/kdrive.h,v 1.25 2002/10/08 21:28:05 keithp Exp $ */
#include <stdio.h>
#include "X.h"
......@@ -706,6 +706,20 @@ KdTuneMode (KdScreenInfo *screen,
Bool (*supported) (KdScreenInfo *,
const KdMonitorTiming *));
#ifdef RANDR
Bool
KdRandRGetInfo (ScreenPtr pScreen,
Bool (*supported) (ScreenPtr pScreen,
const KdMonitorTiming *));
KdMonitorTiming *
KdRandRGetTiming (ScreenPtr pScreen,
Bool (*supported) (ScreenPtr pScreen,
const KdMonitorTiming *),
int rate,
RRScreenSizePtr pSize);
#endif
/* kpict.c */
void
KdPictureInitAsync (ScreenPtr pScreen);
......
......@@ -30,12 +30,12 @@ const KdMonitorTiming kdMonitorTimings[] = {
/* FP BP BLANK POLARITY */
/* Other VESA modes */
{ 640, 350, 85, 31500, /* VESA */
32, 96, 192, KdSyncPositive, /* 37.861 */
32, 60, 95, KdSyncNegative, /* 85.080 */
32, 96, 192, KdSyncPositive, /* 26.413 */
32, 60, 95, KdSyncNegative, /* 59.354 */
},
{ 640, 400, 85, 31500, /* VESA */
32, 96, 192, KdSyncNegative, /* 37.861 */
1, 41, 45, KdSyncPositive, /* 85.080 */
{ 640, 400, 60, 31500, /* VESA */
32, 96, 192, KdSyncNegative, /* 26.413 */
1, 41, 45, KdSyncPositive, /* 59.354 */
},
{ 720, 400, 85, 35500, /* VESA */
36, 108, 216, KdSyncNegative, /* 37.927 */
......@@ -321,3 +321,63 @@ KdTuneMode (KdScreenInfo *screen,
}
return TRUE;
}
#ifdef RANDR
Bool
KdRandRGetInfo (ScreenPtr pScreen,
Bool (*supported) (ScreenPtr pScreen,
const KdMonitorTiming *))
{
KdScreenPriv(pScreen);
KdScreenInfo *screen = pScreenPriv->screen;
int i;
const KdMonitorTiming *t;
for (i = 0, t = kdMonitorTimings; i < NUM_MONITOR_TIMINGS; i++, t++)
{
if ((*supported) (screen, t))
{
RRScreenSizePtr pSize;
pSize = RRRegisterSize (pScreen,
t->horizontal,
t->vertical,
screen->width_mm,
screen->height_mm);
if (!pSize)
return FALSE;
if (!RRRegisterRate (pScreen, pSize, t->rate))
return FALSE;
if (t->horizontal == screen->width &&
t->vertical == screen->height &&
t->rate == screen->rate)
RRSetCurrentConfig (pScreen, randr, t->rate, pSize);
}
}
return TRUE;
}
KdMonitorTiming *
KdRandRGetTiming (ScreenPtr pScreen,
Bool (*supported) (ScreenPtr pScreen,
const KdMonitorTiming *),
int rate,
RRScreenSizePtr pSize)
{
KdScreenPriv(pScreen);
KdScreenInfo *screen = pScreenPriv->screen;
int i;
const KdMonitorTiming *t;
for (i = 0, t = kdMonitorTimings; i < NUM_MONITOR_TIMINGS; i++, t++)
{
if (t->horizontal == pSize->width &&
t->vertical == pSize->height &&
t->rate == rate &&
(*supported) (pScreen, t))
return t;
}
return 0;
}
#endif
......@@ -1049,7 +1049,7 @@ vesaRandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
mode->YResolution == screen->height)
{
int randr = KdSubRotation (pscr->randr, screen->randr);
RRSetCurrentConfig (pScreen, randr, pSize);
RRSetCurrentConfig (pScreen, randr, 0, pSize);
}
}
}
......@@ -1083,6 +1083,7 @@ vesaLayerRemove (WindowPtr pWin, pointer value)
Bool
vesaRandRSetConfig (ScreenPtr pScreen,
Rotation randr,
int rate,
RRScreenSizePtr pSize)
{
KdScreenPriv(pScreen);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment