summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/smi_501.c6
-rw-r--r--src/smi_driver.c16
2 files changed, 9 insertions, 13 deletions
diff --git a/src/smi_501.c b/src/smi_501.c
index 973e33f..273e6ab 100644
--- a/src/smi_501.c
+++ b/src/smi_501.c
@@ -244,7 +244,7 @@ xf86ModeBandwidth(DisplayModePtr mode, int depth)
active_percent = a_active / a_total;
pixels_per_second = active_percent * mode->Clock * 1000.0;
- return ((double)(pixels_per_second * bytes_per_pixel));
+ return ((double)(pixels_per_second * bytes_per_pixel) / 1000.0);
}
#endif
@@ -300,6 +300,10 @@ SMI501_ModeInit(ScrnInfoPtr pScrn, DisplayModePtr xf86mode)
field(mode->clock, m_divider) = 1;
field(mode->clock, m_shift) = 0;
+ /* FIXME probably should not "touch" m2clk. A value other then 112Mhz
+ * will instant lock on my test prototype, "or" maybe it just means
+ * that m2clk value must be equal to mclk value? (and mclk must be
+ * set first!?) */
switch (pSmi->MCLK) {
case 168000: /* 336/1/1 */
field(mode->clock, m2_select) = 1;
diff --git a/src/smi_driver.c b/src/smi_driver.c
index 507e6c7..a1e5dc4 100644
--- a/src/smi_driver.c
+++ b/src/smi_driver.c
@@ -418,19 +418,11 @@ SMI_FreeRec(ScrnInfoPtr pScrn)
ENTER();
- if (pScrn->driverPrivate != NULL) {
- xfree(pScrn->driverPrivate);
- pScrn->driverPrivate = NULL;
- }
-
- if (pSmi->save) {
+ if (pSmi) {
xfree(pSmi->save);
- pSmi->save = NULL;
- }
-
- if (pSmi->mode) {
xfree(pSmi->mode);
- pSmi->mode = NULL;
+ xfree(pScrn->driverPrivate);
+ pScrn->driverPrivate = NULL;
}
LEAVE();
@@ -1054,7 +1046,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
clockRanges->clockIndex = -1;
clockRanges->interlaceAllowed = FALSE;
clockRanges->doubleScanAllowed = FALSE;
-
+
i = xf86ValidateModes(
pScrn, /* Screen pointer */
pScrn->monitor->Modes, /* Available monitor modes */