/* $Id: grid.cpp,v 1.1 2006-11-05 04:42:43 ganzhorn Exp $ * This file is part of lfhex. * Copyright (C) 2006 Salem Ganzhorn * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "grid.hpp" #include #include grid::grid( int cols, QWidget* parent ) : QWidget(parent), m_cols(cols), m_row(0), m_col(0) { setLayout( new QGridLayout(this) ); } void grid::childEvent( QChildEvent* e ) { if( e->added() && e->child()->isWidgetType() ) { QWidget* w = dynamic_cast(e->child()); QGridLayout* l = dynamic_cast(layout()); l->addWidget(w,m_row,m_col); ++m_col; if( m_col >= m_cols ) { m_col = 0; ++m_row; } } } ect> net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2016-11-03 07:16:43 +0100
committerIngo Molnar <mingo@kernel.org>2016-11-03 07:21:12 +0100
commitc7faee2109f978f3ef826c48b7e60609061fda4f (patch)
treed7228d7eeda57462d253ef362d3d5e24932880d1 /drivers
parentb341afb325eb390f707a82cbefd65cda887302ab (diff)
locking/drm: Fix i915_gem_shrinker_lock() locking
Mike Krinkin reported hangs in the DRM code and bisected it to: 3ab7c086d5ec72585ef0 ("locking/drm: Kill mutex trickery") Hugh Dickins observed: "i915_gem_shrinker_lock() is broken: but copy the pattern from msm_gem_shrinker_lock() and it's okay - patch below." Pick up the fix in isolation to make sure the bug is fixed, cleanup patch will follow up. Originally-From: Hugh Dickins <hughd@google.com> Reported-by: Hugh Dickins <hughd@google.com> Reported-by: Mike Krinkin <krinkin.m.u@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Dave Airlie <airlied@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: chris@chris-wilson.co.uk Cc: jason.low2@hpe.com Link: http://lkml.kernel.org/r/alpine.LSU.2.11.1610301645180.28429@eggly.anvils Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_shrinker.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_shrinker.c b/drivers/gpu/drm/i915/i915_gem_shrinker.c