]> Pileus Git - ~andy/linux/blobdiff - drivers/gpu/drm/drm_crtc_helper.c
Merge tag 'v3.2-rc6' of /home/airlied/devel/kernel/linux-2.6 into drm-core-next
[~andy/linux] / drivers / gpu / drm / drm_crtc_helper.c
index d2619d72ceceb16d7b88a33b09708219483019b4..42f86e71479a13cf2b67f906694e62fa751a57b2 100644 (file)
@@ -34,6 +34,7 @@
 
 #include "drmP.h"
 #include "drm_crtc.h"
+#include "drm_fourcc.h"
 #include "drm_crtc_helper.h"
 #include "drm_fb_helper.h"
 
@@ -847,13 +848,19 @@ void drm_helper_connector_dpms(struct drm_connector *connector, int mode)
 EXPORT_SYMBOL(drm_helper_connector_dpms);
 
 int drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb,
-                                  struct drm_mode_fb_cmd *mode_cmd)
+                                  struct drm_mode_fb_cmd2 *mode_cmd)
 {
+       int i;
+
        fb->width = mode_cmd->width;
        fb->height = mode_cmd->height;
-       fb->pitch = mode_cmd->pitch;
-       fb->bits_per_pixel = mode_cmd->bpp;
-       fb->depth = mode_cmd->depth;
+       for (i = 0; i < 4; i++) {
+               fb->pitches[i] = mode_cmd->pitches[i];
+               fb->offsets[i] = mode_cmd->offsets[i];
+       }
+       drm_fb_get_bpp_depth(mode_cmd->pixel_format, &fb->depth,
+                                   &fb->bits_per_pixel);
+       fb->pixel_format = mode_cmd->pixel_format;
 
        return 0;
 }