aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-05-17 13:27:24 +0200
committerDave Airlie <airlied@redhat.com>2012-05-22 10:35:15 +0100
commitebe0f2442cc4c5493a85c875d2d8a44ffecc1175 (patch)
treef9ce0f9183ee558c766916f9b0709e8220242b37 /drivers/gpu/drm
parente6ecefaadfcdb03db8ac9e739b4ba7a93a8811b3 (diff)
downloadkernel_goldelico_gta04-ebe0f2442cc4c5493a85c875d2d8a44ffecc1175.zip
kernel_goldelico_gta04-ebe0f2442cc4c5493a85c875d2d8a44ffecc1175.tar.gz
kernel_goldelico_gta04-ebe0f2442cc4c5493a85c875d2d8a44ffecc1175.tar.bz2
drm: Make the CRTC gamma_set operation optional
Drivers for hardware without gamma support should not be forced to implement a no-op gamma set operation. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Rob Clark <rob.clark@linaro.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/drm_crtc.c5
-rw-r--r--drivers/gpu/drm/drm_fb_helper.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 404597e..6cb47d9 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -3332,6 +3332,11 @@ int drm_mode_gamma_set_ioctl(struct drm_device *dev,
}
crtc = obj_to_crtc(obj);
+ if (crtc->funcs->gamma_set == NULL) {
+ ret = -ENOSYS;
+ goto out;
+ }
+
/* memcpy into gamma store */
if (crtc_lut->gamma_size != crtc->gamma_size) {
ret = -EINVAL;
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 9b773d5..5683b7f 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -136,6 +136,9 @@ static void drm_fb_helper_restore_lut_atomic(struct drm_crtc *crtc)
{
uint16_t *r_base, *g_base, *b_base;
+ if (crtc->funcs->gamma_set == NULL)
+ return;
+
r_base = crtc->gamma_store;
g_base = r_base + crtc->gamma_size;
b_base = g_base + crtc->gamma_size;