aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/efifb.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /drivers/video/efifb.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/video/efifb.c')
-rw-r--r--drivers/video/efifb.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c
index eb12182b2059..ecf405562f5c 100644
--- a/drivers/video/efifb.c
+++ b/drivers/video/efifb.c
@@ -49,6 +49,7 @@ enum {
49 M_MBP_2, /* MacBook Pro 2nd gen */ 49 M_MBP_2, /* MacBook Pro 2nd gen */
50 M_MBP_SR, /* MacBook Pro (Santa Rosa) */ 50 M_MBP_SR, /* MacBook Pro (Santa Rosa) */
51 M_MBP_4, /* MacBook Pro, 4th gen */ 51 M_MBP_4, /* MacBook Pro, 4th gen */
52 M_MBP_5_1, /* MacBook Pro, 5,1th gen */
52 M_UNKNOWN /* placeholder */ 53 M_UNKNOWN /* placeholder */
53}; 54};
54 55
@@ -70,6 +71,7 @@ static struct efifb_dmi_info {
70 [M_MBP_2] = { "mbp2", 0, 0, 0, 0 }, /* placeholder */ 71 [M_MBP_2] = { "mbp2", 0, 0, 0, 0 }, /* placeholder */
71 [M_MBP_SR] = { "mbp3", 0x80030000, 2048 * 4, 1440, 900 }, 72 [M_MBP_SR] = { "mbp3", 0x80030000, 2048 * 4, 1440, 900 },
72 [M_MBP_4] = { "mbp4", 0xc0060000, 2048 * 4, 1920, 1200 }, 73 [M_MBP_4] = { "mbp4", 0xc0060000, 2048 * 4, 1920, 1200 },
74 [M_MBP_5_1] = { "mbp51", 0xc0010000, 2048 * 4, 1440, 900 },
73 [M_UNKNOWN] = { NULL, 0, 0, 0, 0 } 75 [M_UNKNOWN] = { NULL, 0, 0, 0, 0 }
74}; 76};
75 77
@@ -106,6 +108,7 @@ static struct dmi_system_id __initdata dmi_system_table[] = {
106 EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro3,1", M_MBP_SR), 108 EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro3,1", M_MBP_SR),
107 EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro3,1", M_MBP_SR), 109 EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro3,1", M_MBP_SR),
108 EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro4,1", M_MBP_4), 110 EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro4,1", M_MBP_4),
111 EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro5,1", M_MBP_5_1),
109 {}, 112 {},
110}; 113};
111 114
@@ -161,8 +164,17 @@ static int efifb_setcolreg(unsigned regno, unsigned red, unsigned green,
161 return 0; 164 return 0;
162} 165}
163 166
167static void efifb_destroy(struct fb_info *info)
168{
169 if (info->screen_base)
170 iounmap(info->screen_base);
171 release_mem_region(info->aperture_base, info->aperture_size);
172 framebuffer_release(info);
173}
174
164static struct fb_ops efifb_ops = { 175static struct fb_ops efifb_ops = {
165 .owner = THIS_MODULE, 176 .owner = THIS_MODULE,
177 .fb_destroy = efifb_destroy,
166 .fb_setcolreg = efifb_setcolreg, 178 .fb_setcolreg = efifb_setcolreg,
167 .fb_fillrect = cfb_fillrect, 179 .fb_fillrect = cfb_fillrect,
168 .fb_copyarea = cfb_copyarea, 180 .fb_copyarea = cfb_copyarea,
@@ -201,7 +213,7 @@ static int __init efifb_setup(char *options)
201 return 0; 213 return 0;
202} 214}
203 215
204static int __init efifb_probe(struct platform_device *dev) 216static int __devinit efifb_probe(struct platform_device *dev)
205{ 217{
206 struct fb_info *info; 218 struct fb_info *info;
207 int err; 219 int err;
@@ -281,7 +293,7 @@ static int __init efifb_probe(struct platform_device *dev)
281 info->par = NULL; 293 info->par = NULL;
282 294
283 info->aperture_base = efifb_fix.smem_start; 295 info->aperture_base = efifb_fix.smem_start;
284 info->aperture_size = size_total; 296 info->aperture_size = size_remap;
285 297
286 info->screen_base = ioremap(efifb_fix.smem_start, efifb_fix.smem_len); 298 info->screen_base = ioremap(efifb_fix.smem_start, efifb_fix.smem_len);
287 if (!info->screen_base) { 299 if (!info->screen_base) {