On Wed, Sep 10, 2014 at 04:50:56PM +0530, Sharma, Shashank wrote: ... > >>+ > >>+/* Properties */ > >>+enum clrmgr_tweaks { > >>+ csc = 0, > >>+ gamma, > >>+ contrast, > >>+ brightness, > >>+ hue_saturation, > >>+ clrmgr_tweak_invalid > >>+}; > > > >These are just enums into your property name array, right? I'm not > >sure if we need these either. > > > > > Actually my plan was like this: > One enum(like this), which assigns color property id to each property. > Arrays, arranged in order of this enum for sizes, name and > init_values of these properties. So it would be easy to access, easy > to plug in new property, and less hard coding. > +/* Properties */ > enum clrmgr_tweaks { > csc = 0, > gamma, > contrast, > brightness, > hue_saturation, > clrmgr_tweak_invalid > }; > > array color_prop_sizes{size_csc, size_gamma, size_cont, size_bright}; > array color_prop_name{"csc", "gamma", "cont", "bright"}; > array init_values{{9 init values for CSC} {129 init values for > gamma} {1 default value of contrast} {1 default val for brightness}} > > Does it look that bad :) ? Okay, I think I see what you were going for, but I'm still not convinced that pulling these values out into separate arrays is more clear at the moment. You still have to make sure your arrays stay in sync and if there's any control flow (e.g., some properties are only relevant on certain platforms), then that gets more complicated as well. I'd suggest not using the arrays for now while we only have a handful of properties. Once we have a large list of properties in the driver maybe we can revisit whether there's a nicer way to stick them in a table and simplify the code. Matt -- Matt Roper Graphics Software Engineer IoTG Platform Enabling & Development Intel Corporation (916) 356-2795 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx