Skip to content

Commit 6490311

Browse files
lumaggregkh
authored andcommitted
staging/xgifb: fix display on XGI Volari Z11m cards
Image on Z11m cards was totally garbled due to wrong memory being selected. Add a special handling for Z11m cards. Tested on PCIe Z11 and Z11m cards. Signed-off-by: Dmitry Eremin-Solenikov <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 5d92f71 commit 6490311

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

drivers/staging/xgifb/vb_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ XGINew_GetXG20DRAMType(struct xgi_hw_device_info *HwDeviceExtension,
6161
}
6262
temp = xgifb_reg_get(pVBInfo->P3c4, 0x3B);
6363
/* SR3B[7][3]MAA15 MAA11 (Power on Trapping) */
64-
if ((temp & 0x88) == 0x80)
64+
if (((temp & 0x88) == 0x80) || ((temp & 0x88) == 0x08))
6565
data = 0; /* DDR */
6666
else
6767
data = 1; /* DDRII */

drivers/staging/xgifb/vb_setmode.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ void InitTo330Pointer(unsigned char ChipType, struct vb_device_info *pVBInfo)
152152
pVBInfo->pXGINew_CR97 = &XG20_CR97;
153153

154154
if (ChipType == XG27) {
155+
unsigned char temp;
155156
pVBInfo->MCLKData
156157
= (struct SiS_MCLKData *) XGI27New_MCLKData;
157158
pVBInfo->CR40 = XGI27_cr41;
@@ -162,7 +163,13 @@ void InitTo330Pointer(unsigned char ChipType, struct vb_device_info *pVBInfo)
162163
pVBInfo->pCRDE = XG27_CRDE;
163164
pVBInfo->pSR40 = &XG27_SR40;
164165
pVBInfo->pSR41 = &XG27_SR41;
166+
pVBInfo->SR15 = XG27_SR13;
165167

168+
/*Z11m DDR*/
169+
temp = xgifb_reg_get(pVBInfo->P3c4, 0x3B);
170+
/* SR3B[7][3]MAA15 MAA11 (Power on Trapping) */
171+
if (((temp & 0x88) == 0x80) || ((temp & 0x88) == 0x08))
172+
pVBInfo->pXGINew_CR97 = &Z11m_CR97;
166173
}
167174

168175
if (ChipType >= XG20) {

drivers/staging/xgifb/vb_table.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ static struct XGI_ECLKDataStruct XGI340_ECLKData[] = {
3333
{0x5c, 0x23, 0x01, 166}
3434
};
3535

36+
static unsigned char XG27_SR13[4][8] = {
37+
{0x35, 0x45, 0xb1, 0x00, 0x00, 0x00, 0x00, 0x00}, /* SR13 */
38+
{0x41, 0x51, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00}, /* SR14 */
39+
{0x32, 0x32, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00}, /* SR18 */
40+
{0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00} /* SR1B */
41+
};
42+
3643
static unsigned char XGI340_SR13[4][8] = {
3744
{0x35, 0x45, 0xb1, 0x00, 0x00, 0x00, 0x00, 0x00}, /* SR13 */
3845
{0x41, 0x51, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00}, /* SR14 */
@@ -71,7 +78,7 @@ static unsigned char XGI27_cr41[24][8] = {
7178
{0x20, 0x40, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0 CR41 */
7279
{0xC4, 0x40, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 1 CR8A */
7380
{0xC4, 0x40, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 2 CR8B */
74-
{0xB5, 0x13, 0xa4, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 3 CR40[7],
81+
{0xB3, 0x13, 0xa4, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 3 CR40[7],
7582
CR99[2:0],
7683
CR45[3:0]*/
7784
{0xf0, 0xf5, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 4 CR59 */
@@ -2803,6 +2810,8 @@ static unsigned char XG27_CRDE[2];
28032810
static unsigned char XG27_SR40 = 0x04 ;
28042811
static unsigned char XG27_SR41 = 0x00 ;
28052812

2813+
static unsigned char Z11m_CR97 = 0x80 ;
2814+
28062815
static struct XGI330_VCLKDataStruct XGI_VCLKData[] = {
28072816
/* SR2B,SR2C,SR2D */
28082817
{0x1B, 0xE1, 25}, /* 00 (25.175MHz) */

0 commit comments

Comments
 (0)