Subversion Repositories Kolibri OS

Rev

Rev 3746 | Rev 4539 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3746 Rev 4104
Line 112... Line 112...
112
static void drm_fb_helper_save_lut_atomic(struct drm_crtc *crtc, struct drm_fb_helper *helper)
112
static void drm_fb_helper_save_lut_atomic(struct drm_crtc *crtc, struct drm_fb_helper *helper)
113
{
113
{
114
	uint16_t *r_base, *g_base, *b_base;
114
	uint16_t *r_base, *g_base, *b_base;
115
	int i;
115
	int i;
Line -... Line 116...
-
 
116
 
-
 
117
	if (helper->funcs->gamma_get == NULL)
-
 
118
		return;
116
 
119
 
117
	r_base = crtc->gamma_store;
120
	r_base = crtc->gamma_store;
118
	g_base = r_base + crtc->gamma_size;
121
	g_base = r_base + crtc->gamma_size;
Line 119... Line 122...
119
	b_base = g_base + crtc->gamma_size;
122
	b_base = g_base + crtc->gamma_size;
Line 335... Line 338...
335
		}
338
		}
336
		palette[regno] = value;
339
		palette[regno] = value;
337
		return 0;
340
		return 0;
338
	}
341
	}
Line -... Line 342...
-
 
342
 
-
 
343
	/*
-
 
344
	 * The driver really shouldn't advertise pseudo/directcolor
-
 
345
	 * visuals if it can't deal with the palette.
-
 
346
	 */
-
 
347
	if (WARN_ON(!fb_helper->funcs->gamma_set ||
-
 
348
		    !fb_helper->funcs->gamma_get))
-
 
349
		return -EINVAL;
339
 
350
 
Line 340... Line 351...
340
	pindex = regno;
351
	pindex = regno;
341
 
352
 
Line 378... Line 389...
378
 * @info: fbdev registered by the helper
389
 * @info: fbdev registered by the helper
379
 */
390
 */
380
int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info)
391
int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info)
381
{
392
{
382
	struct drm_fb_helper *fb_helper = info->par;
393
	struct drm_fb_helper *fb_helper = info->par;
-
 
394
	struct drm_device *dev = fb_helper->dev;
383
	struct drm_crtc_helper_funcs *crtc_funcs;
395
	struct drm_crtc_helper_funcs *crtc_funcs;
384
	u16 *red, *green, *blue, *transp;
396
	u16 *red, *green, *blue, *transp;
385
	struct drm_crtc *crtc;
397
	struct drm_crtc *crtc;
386
	int i, j, rc = 0;
398
	int i, j, rc = 0;
387
	int start;
399
	int start;
Line -... Line 400...
-
 
400
 
-
 
401
	drm_modeset_lock_all(dev);
-
 
402
	if (!drm_fb_helper_is_bound(fb_helper)) {
-
 
403
		drm_modeset_unlock_all(dev);
-
 
404
		return -EBUSY;
-
 
405
	}
388
 
406
 
389
		for (i = 0; i < fb_helper->crtc_count; i++) {
407
		for (i = 0; i < fb_helper->crtc_count; i++) {
390
		crtc = fb_helper->crtc_info[i].mode_set.crtc;
408
		crtc = fb_helper->crtc_info[i].mode_set.crtc;
Line 391... Line 409...
391
		crtc_funcs = crtc->helper_private;
409
		crtc_funcs = crtc->helper_private;
Line 406... Line 424...
406
			if (transp)
424
			if (transp)
407
				htransp = *transp++;
425
				htransp = *transp++;
Line 408... Line 426...
408
 
426
 
409
			rc = setcolreg(crtc, hred, hgreen, hblue, start++, info);
427
			rc = setcolreg(crtc, hred, hgreen, hblue, start++, info);
410
			if (rc)
428
			if (rc)
411
				return rc;
429
				goto out;
-
 
430
		}
412
		}
431
		if (crtc_funcs->load_lut)
413
		crtc_funcs->load_lut(crtc);
432
		crtc_funcs->load_lut(crtc);
-
 
433
	}
-
 
434
 out:
414
	}
435
	drm_modeset_unlock_all(dev);
415
	return rc;
436
	return rc;
416
}
437
}
Line 417... Line 438...
417
EXPORT_SYMBOL(drm_fb_helper_setcmap);
438
EXPORT_SYMBOL(drm_fb_helper_setcmap);