From owner-svn-src-head@FreeBSD.ORG Wed Aug 28 19:06:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7C05B80A; Wed, 28 Aug 2013 19:06:23 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4FE2B201B; Wed, 28 Aug 2013 19:06:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7SJ6NCQ022318; Wed, 28 Aug 2013 19:06:23 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7SJ6N4e022317; Wed, 28 Aug 2013 19:06:23 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201308281906.r7SJ6N4e022317@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 28 Aug 2013 19:06:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254999 - head/sys/dev/fb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Aug 2013 19:06:23 -0000 Author: jkim Date: Wed Aug 28 19:06:22 2013 New Revision: 254999 URL: http://svnweb.freebsd.org/changeset/base/254999 Log: Do not save/restore video memory if we are not using linear frame buffer. Note this partially revert r233896. Modified: head/sys/dev/fb/vesa.c Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Wed Aug 28 18:13:37 2013 (r254998) +++ head/sys/dev/fb/vesa.c Wed Aug 28 19:06:22 2013 (r254999) @@ -1,6 +1,6 @@ /*- * Copyright (c) 1998 Kazutaka YOKOTA and Michael Smith - * Copyright (c) 2009-2012 Jung-uk Kim + * Copyright (c) 2009-2013 Jung-uk Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1463,7 +1463,7 @@ vesa_set_border(video_adapter_t *adp, in static int vesa_save_state(video_adapter_t *adp, void *p, size_t size) { - vm_offset_t buf; + void *buf; size_t bsize; if (adp != vesa_adp || (size == 0 && vesa_state_buf_size == 0)) @@ -1479,17 +1479,14 @@ vesa_save_state(video_adapter_t *adp, vo free(vesa_vmem_buf, M_DEVBUF); vesa_vmem_buf = NULL; } - if (VESA_MODE(adp->va_mode) && adp->va_buffer != 0) { - buf = adp->va_buffer; - bsize = adp->va_buffer_size; - } else { - buf = adp->va_window; - bsize = adp->va_window_size; - } - if (buf != 0) { - vesa_vmem_buf = malloc(bsize, M_DEVBUF, M_NOWAIT); - if (vesa_vmem_buf != NULL) - bcopy((void *)buf, vesa_vmem_buf, bsize); + if (VESA_MODE(adp->va_mode)) { + buf = (void *)adp->va_buffer; + if (buf != NULL) { + bsize = adp->va_buffer_size; + vesa_vmem_buf = malloc(bsize, M_DEVBUF, M_NOWAIT); + if (vesa_vmem_buf != NULL) + bcopy(buf, vesa_vmem_buf, bsize); + } } if (vesa_state_buf_size == 0) return ((*prevvidsw->save_state)(adp, p, size)); @@ -1500,7 +1497,7 @@ vesa_save_state(video_adapter_t *adp, vo static int vesa_load_state(video_adapter_t *adp, void *p) { - vm_offset_t buf; + void *buf; size_t bsize; int error, mode; @@ -1515,16 +1512,12 @@ vesa_load_state(video_adapter_t *adp, vo error = vesa_set_mode(adp, mode); if (vesa_vmem_buf != NULL) { - if (error == 0) { - if (VESA_MODE(mode) && adp->va_buffer != 0) { - buf = adp->va_buffer; + if (error == 0 && VESA_MODE(mode)) { + buf = (void *)adp->va_buffer; + if (buf != NULL) { bsize = adp->va_buffer_size; - } else { - buf = adp->va_window; - bsize = adp->va_window_size; + bcopy(vesa_vmem_buf, buf, bsize); } - if (buf != 0) - bcopy(vesa_vmem_buf, (void *)buf, bsize); } free(vesa_vmem_buf, M_DEVBUF); vesa_vmem_buf = NULL;