From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Harvey Subject: [PATCH] mgag200: some cleanup and a fix for corrupted output Date: Tue, 26 Feb 2013 10:52:55 -0500 Message-ID: <20130226155255.GA18595@harvey-pc.matrox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mtxmxout7.matrox.com (mtxmxout9.matrox.com [138.11.2.99]) by gabe.freedesktop.org (Postfix) with ESMTP id 412EFE65C9 for ; Tue, 26 Feb 2013 08:14:34 -0800 (PST) Received: from mars.matrox.com (mars.matrox.com [192.168.1.29]) by mtxmxout7.matrox.com (Postfix) with ESMTP id 4F9CD1C6E02 for ; Tue, 26 Feb 2013 10:48:36 -0500 (EST) Received: (from ssmsp@localhost) by mars.matrox.com (8.14.4/8.13.2) id r1QFmaIJ010974 for dri-devel@lists.freedesktop.org; Tue, 26 Feb 2013 10:48:36 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by mars.matrox.com (Postfix) with ESMTP id B438C9553D for ; Tue, 26 Feb 2013 10:48:35 -0500 (EST) Received: from pluton.matrox.com (pluton.matrox.com [192.168.8.7]) by mars.matrox.com (Postfix) with ESMTP id 95C309524D for ; Tue, 26 Feb 2013 10:48:35 -0500 (EST) Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: dri-devel@lists.freedesktop.org Cc: Julia Lemire , Mathieu Larouche List-Id: dri-devel@lists.freedesktop.org Patches 1 to 4 are just cleanup. Maybe these should should be rolled into one patch? Patch 5 is a bit more complicated. On cards with very little video memory, (e.g 8MB) higher resolutions at 32bit framebuffer depths will get corrupted because the required memory is larger than what the framebuffer has. DRM has "max_height" and "max_width" but no "max_bytes" for limiting resolutions, so the patch is a little hacky. The first for loop tries to associate a connector with the mode being tested. From the connector I can get the bpp if the user specified one on the video= commandline. After that I do 2 things: 1) Invalidate the requested mode from the video= parameter 2) Return MODE_BAD if the framebuffer would be too large I feel this patch plays with structures it shouldn't have to touch to get the bpp. An alternative fix would be to include a "max_bytes" in the DRM core and then do these checks there. I'm also wondering, did I miss the 3.9.0 merge window? Thanks, Christopher Harvey (5): drm/mgag200: Cleanup: Remove pointless call to drm_fb_get_bpp_depth drm/mgag200: Cleanup: 'fbdev_list' in 'struct mga_fbdev' is not used drm/mgag200: Cleanup: Pass driver specific mga_device in driver functions drm/mgag200: Cleanup: Remove extra variable assigns drm/mgag200: Reject modes that are too big for VRAM drivers/gpu/drm/mgag200/mgag200_drv.h | 1 - drivers/gpu/drm/mgag200/mgag200_fb.c | 3 --- drivers/gpu/drm/mgag200/mgag200_main.c | 2 -- drivers/gpu/drm/mgag200/mgag200_mode.c | 34 ++++++++++++++++++++++++++++++---- 4 files changed, 30 insertions(+), 10 deletions(-) -- 1.7.12.4